mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 05:56:18 +00:00
fix: accept extension batch separator
This commit is contained in:
@@ -22,9 +22,11 @@ function printUsage() {
|
||||
}
|
||||
|
||||
export function parseExtensionIds(rawArgs) {
|
||||
const separatorIndex = rawArgs.indexOf("--");
|
||||
const args = separatorIndex >= 0 ? rawArgs.slice(0, separatorIndex) : [...rawArgs];
|
||||
const separatorPassthroughArgs = separatorIndex >= 0 ? rawArgs.slice(separatorIndex + 1) : [];
|
||||
const normalizedArgs = rawArgs[0] === "--" ? rawArgs.slice(1) : rawArgs;
|
||||
const separatorIndex = normalizedArgs.indexOf("--");
|
||||
const args = separatorIndex >= 0 ? normalizedArgs.slice(0, separatorIndex) : [...normalizedArgs];
|
||||
const separatorPassthroughArgs =
|
||||
separatorIndex >= 0 ? normalizedArgs.slice(separatorIndex + 1) : [];
|
||||
const extensionIds = [];
|
||||
|
||||
while (args[0] && !args[0].startsWith("-")) {
|
||||
|
||||
@@ -718,6 +718,13 @@ describe("scripts/test-extension.mjs", () => {
|
||||
expect([...parseExactVitestExcludePaths(["--exclude=extensions/**/*.test.ts"])]).toEqual([]);
|
||||
});
|
||||
|
||||
it("accepts pnpm's leading argument separator before extension ids", () => {
|
||||
expect(parseExtensionIds(["--", "telegram,slack", "--run"])).toEqual({
|
||||
extensionIds: ["telegram", "slack"],
|
||||
passthroughArgs: ["--run"],
|
||||
});
|
||||
});
|
||||
|
||||
it("fails explicitly requested extensions without tests by default", () => {
|
||||
const extensionId = findExtensionWithoutTests();
|
||||
const result = runScriptResult([extensionId]);
|
||||
|
||||
Reference in New Issue
Block a user