@aiusage/cli 1.7.8 → 1.7.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/dist/cli.js +4 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5373,6 +5373,7 @@ async function requestJson(url, init) {
|
|
|
5373
5373
|
}
|
|
5374
5374
|
|
|
5375
5375
|
// src/schedule.ts
|
|
5376
|
+
import { realpathSync } from "node:fs";
|
|
5376
5377
|
import { mkdir as mkdir2, readFile as readFile16, stat as stat4, unlink, writeFile as writeFile2 } from "node:fs/promises";
|
|
5377
5378
|
import { execFile as execFile2 } from "node:child_process";
|
|
5378
5379
|
import { promisify } from "node:util";
|
|
@@ -5413,7 +5414,9 @@ async function getScheduleStatus() {
|
|
|
5413
5414
|
return platform() === "darwin" ? getLaunchdStatus() : getCronStatus();
|
|
5414
5415
|
}
|
|
5415
5416
|
function resolveCommandPaths() {
|
|
5416
|
-
let
|
|
5417
|
+
let entryPath = process.argv[1];
|
|
5418
|
+
if (!entryPath) throw new Error("\u65E0\u6CD5\u89E3\u6790\u5F53\u524D aiusage \u547D\u4EE4\u8DEF\u5F84");
|
|
5419
|
+
let scriptPath = realpathSync(resolve5(entryPath));
|
|
5417
5420
|
if (scriptPath.includes("_npx") || scriptPath.includes("/npx-"))
|
|
5418
5421
|
throw new Error(
|
|
5419
5422
|
`\u68C0\u6D4B\u5230\u901A\u8FC7 npx \u8FD0\u884C\uFF0C\u5B9A\u65F6\u4EFB\u52A1\u9700\u8981\u5168\u5C40\u5B89\u88C5\u3002
|