@fmode/studio 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/fmode.js +12 -6
- package/cli.js +12 -6
- package/package.json +1 -1
package/bin/fmode.js
CHANGED
|
@@ -1064,12 +1064,18 @@ async function runCli() {
|
|
|
1064
1064
|
break;
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
var
|
|
1068
|
-
if (
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1067
|
+
var scriptPath = process.argv[1];
|
|
1068
|
+
if (scriptPath) {
|
|
1069
|
+
const normalizedScriptPath = scriptPath.replace(/\\/g, "/");
|
|
1070
|
+
const absolutePath = normalizedScriptPath.startsWith("/") ? normalizedScriptPath : `/${normalizedScriptPath}`;
|
|
1071
|
+
const scriptUrl = `file://${absolutePath}`;
|
|
1072
|
+
const isMainModule = import.meta.url === scriptUrl;
|
|
1073
|
+
if (isMainModule) {
|
|
1074
|
+
runCli().catch((error) => {
|
|
1075
|
+
console.error("Fatal error:", error);
|
|
1076
|
+
process.exit(1);
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1073
1079
|
}
|
|
1074
1080
|
export {
|
|
1075
1081
|
showVersion,
|
package/cli.js
CHANGED
|
@@ -1052,12 +1052,18 @@ async function runCli() {
|
|
|
1052
1052
|
break;
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
|
-
var
|
|
1056
|
-
if (
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1055
|
+
var scriptPath = process.argv[1];
|
|
1056
|
+
if (scriptPath) {
|
|
1057
|
+
const normalizedScriptPath = scriptPath.replace(/\\/g, "/");
|
|
1058
|
+
const absolutePath = normalizedScriptPath.startsWith("/") ? normalizedScriptPath : `/${normalizedScriptPath}`;
|
|
1059
|
+
const scriptUrl = `file://${absolutePath}`;
|
|
1060
|
+
const isMainModule = import.meta.url === scriptUrl;
|
|
1061
|
+
if (isMainModule) {
|
|
1062
|
+
runCli().catch((error) => {
|
|
1063
|
+
console.error("Fatal error:", error);
|
|
1064
|
+
process.exit(1);
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1061
1067
|
}
|
|
1062
1068
|
export {
|
|
1063
1069
|
showVersion,
|