Skip to content

Commit e449f95

Browse files
committed
fix: improve cross-platform compatibility for script execution in index template
1 parent 668417d commit e449f95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adminforth/commands/createApp/templates/index.ts.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ export const admin = new AdminForth({
5555
],
5656
});
5757

58-
if (import.meta.url === `file://${process.argv[1]}`) {
58+
// Cross-platform check if script is executed directly
59+
const isMainModule = import.meta.url === new URL(process.argv[1], 'file:').href;
60+
if (isMainModule) {
5961
const app = express();
6062
app.use(express.json());
6163

0 commit comments

Comments
 (0)