nodalis-compiler 1.0.17 → 1.0.18
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/package.json +1 -1
- package/src/nodalis.js +12 -2
package/package.json
CHANGED
package/src/nodalis.js
CHANGED
|
@@ -182,8 +182,18 @@ export class Nodalis {
|
|
|
182
182
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
function isCliEntryPoint() {
|
|
186
|
+
try {
|
|
187
|
+
if (!process.argv[1]) return false;
|
|
188
|
+
const invokedPath = fs.realpathSync(process.argv[1]);
|
|
189
|
+
const modulePath = fs.realpathSync(fileURLToPath(import.meta.url));
|
|
190
|
+
return invokedPath === modulePath;
|
|
191
|
+
} catch {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (isCliEntryPoint()) {
|
|
187
197
|
|
|
188
198
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
189
199
|
console.log(`
|