@amaster.ai/runtime-cli 1.1.12 → 1.1.13
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/dist/cli.cjs +13 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +2 -1
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +14 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var fs = require('fs');
|
|
4
4
|
var path = require('path');
|
|
5
5
|
var os = require('os');
|
|
6
|
+
var url = require('url');
|
|
6
7
|
var commander = require('commander');
|
|
7
8
|
var chalk3 = require('chalk');
|
|
8
9
|
var client = require('@amaster.ai/client');
|
|
@@ -3193,8 +3194,17 @@ s3Cmd.command("metadata <key>").description("Get file metadata").option("--app <
|
|
|
3193
3194
|
format: options.format
|
|
3194
3195
|
});
|
|
3195
3196
|
});
|
|
3196
|
-
|
|
3197
|
-
if (
|
|
3197
|
+
function isDirectCliExecution(entryArg = process.argv[1]) {
|
|
3198
|
+
if (!entryArg) {
|
|
3199
|
+
return false;
|
|
3200
|
+
}
|
|
3201
|
+
try {
|
|
3202
|
+
return fs.realpathSync(entryArg) === fs.realpathSync(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
3203
|
+
} catch {
|
|
3204
|
+
return false;
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
3207
|
+
if (isDirectCliExecution()) {
|
|
3198
3208
|
program.parseAsync(process.argv).then(
|
|
3199
3209
|
() => process.exit(0),
|
|
3200
3210
|
(err) => {
|