mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 00:27:57 +00:00
fix(update): reject openclaw source package targets
This commit is contained in:
@@ -96,4 +96,17 @@ describe("install-cli.sh", () => {
|
||||
expect(script).toContain('freshness_flag="--before=$(date -u');
|
||||
expect(script).toContain("env -u NPM_CONFIG_BEFORE -u npm_config_before");
|
||||
});
|
||||
|
||||
it("rejects OpenClaw GitHub source targets for npm installs", () => {
|
||||
const result = runInstallCliShell(`
|
||||
set -euo pipefail
|
||||
source "${SCRIPT_PATH}"
|
||||
OPENCLAW_VERSION=main
|
||||
install_openclaw
|
||||
`);
|
||||
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stdout).toContain("npm installs do not support OpenClaw GitHub source targets");
|
||||
expect(result.stdout).toContain("--install-method git --version main");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -104,6 +104,16 @@ describe("install.ps1 failure handling", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects OpenClaw GitHub source targets for npm installs", () => {
|
||||
const npmInstallBody = extractFunctionBody(source, "Install-OpenClaw");
|
||||
const sourceTargetBody = extractFunctionBody(source, "Test-OpenClawSourcePackageInstallSpec");
|
||||
expect(sourceTargetBody).toContain('$normalizedTag -eq "main"');
|
||||
expect(sourceTargetBody).toContain("^github:openclaw/openclaw");
|
||||
expect(npmInstallBody).toContain("Test-OpenClawSourcePackageInstallSpec -RequestedTag $Tag");
|
||||
expect(npmInstallBody).toContain("npm installs do not support OpenClaw GitHub source targets");
|
||||
expect(npmInstallBody).toContain("-InstallMethod git -Tag main");
|
||||
});
|
||||
|
||||
it("cleans legacy git submodules only from the selected git checkout", () => {
|
||||
const gitInstallBody = extractFunctionBody(source, "Install-OpenClawFromGit");
|
||||
const mainBody = extractFunctionBody(source, "Main");
|
||||
|
||||
@@ -41,6 +41,24 @@ describe("install.sh", () => {
|
||||
expect(script).toContain('cmd+=(--no-fund --no-audit "$freshness_flag" install -g "$spec")');
|
||||
});
|
||||
|
||||
it("rejects OpenClaw GitHub source targets for npm installs", () => {
|
||||
const result = runInstallShell(`
|
||||
set -euo pipefail
|
||||
source "${SCRIPT_PATH}"
|
||||
set +e
|
||||
OPENCLAW_VERSION=main
|
||||
USE_BETA=0
|
||||
install_openclaw
|
||||
status=$?
|
||||
printf 'status=%s\\n' "$status"
|
||||
`);
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stdout).toContain("status=1");
|
||||
expect(result.stdout).toContain("npm installs do not support OpenClaw GitHub source targets");
|
||||
expect(result.stdout).toContain("--install-method git --version main");
|
||||
});
|
||||
|
||||
it("exports noninteractive apt env during Linux startup", () => {
|
||||
expect(script).toMatch(
|
||||
/detect_os_or_die\s+if \[\[ "\$OS" == "linux" \]\]; then\s+export DEBIAN_FRONTEND="\$\{DEBIAN_FRONTEND:-noninteractive\}"\s+export NEEDRESTART_MODE="\$\{NEEDRESTART_MODE:-a\}"\s+fi/m,
|
||||
|
||||
Reference in New Issue
Block a user