mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-01 12:13:38 +00:00
fix(plugin): require runtime build package targets
This commit is contained in:
@@ -11,16 +11,20 @@ import {
|
||||
resolvePluginNpmRuntimeBuildPlan,
|
||||
} from "./lib/plugin-npm-runtime-build.mjs";
|
||||
|
||||
function parseArgs(argv) {
|
||||
function readPackageArgValue(argv, index) {
|
||||
const value = argv[index + 1];
|
||||
if (value === undefined || value === "" || value.startsWith("--")) {
|
||||
throw new Error("missing value for --package");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
export function parseArgs(argv) {
|
||||
const packageDirs = [];
|
||||
for (let index = 0; index < argv.length; index += 1) {
|
||||
const arg = argv[index];
|
||||
if (arg === "--package") {
|
||||
const packageDir = argv[index + 1];
|
||||
if (!packageDir) {
|
||||
throw new Error("missing value for --package");
|
||||
}
|
||||
packageDirs.push(packageDir);
|
||||
packageDirs.push(readPackageArgValue(argv, index));
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -294,11 +294,16 @@ export async function buildPluginNpmRuntime(params) {
|
||||
};
|
||||
}
|
||||
|
||||
function parseArgs(argv) {
|
||||
function readPackageDirArg(argv) {
|
||||
const packageDir = argv[0];
|
||||
if (!packageDir) {
|
||||
if (!packageDir || packageDir.startsWith("--")) {
|
||||
throw new Error("usage: node scripts/lib/plugin-npm-runtime-build.mjs <package-dir>");
|
||||
}
|
||||
return packageDir;
|
||||
}
|
||||
|
||||
export function parseArgs(argv) {
|
||||
const packageDir = readPackageDirArg(argv);
|
||||
return { packageDir };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user