Skip to content

Commit f69ef87

Browse files
author
openclaw-installer-sync[bot]
committed
chore: sync installers from openclaw dae90067e90e
1 parent a347fd4 commit f69ef87

2 files changed

Lines changed: 52 additions & 20 deletions

File tree

public/install-cli.sh

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -414,29 +414,31 @@ checkout_git_openclaw_ref() {
414414
return 0
415415
fi
416416

417-
git -C "$repo_dir" fetch --tags origin
418-
419417
if [[ "$ref" == "main" ]]; then
418+
git -C "$repo_dir" fetch --no-tags origin main
420419
git -C "$repo_dir" checkout main
421420
if [[ "$GIT_UPDATE" == "1" ]]; then
422-
git -C "$repo_dir" pull --rebase || true
421+
git -C "$repo_dir" pull --rebase --no-tags || true
423422
fi
424423
return 0
425424
fi
426425

427-
if git -C "$repo_dir" rev-parse --verify --quiet "refs/tags/${ref}^{commit}" >/dev/null; then
428-
git -C "$repo_dir" checkout --detach "$ref"
429-
return 0
430-
fi
431-
432426
if git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
427+
git -C "$repo_dir" fetch --no-tags origin "refs/heads/${ref}:refs/remotes/origin/${ref}"
433428
git -C "$repo_dir" checkout -B "$ref" "origin/$ref"
434429
if [[ "$GIT_UPDATE" == "1" ]]; then
435-
git -C "$repo_dir" pull --rebase || true
430+
git -C "$repo_dir" pull --rebase --no-tags || true
436431
fi
437432
return 0
438433
fi
439434

435+
git -C "$repo_dir" fetch --tags origin
436+
437+
if git -C "$repo_dir" rev-parse --verify --quiet "refs/tags/${ref}^{commit}" >/dev/null; then
438+
git -C "$repo_dir" checkout --detach "$ref"
439+
return 0
440+
fi
441+
440442
if git -C "$repo_dir" rev-parse --verify --quiet "${ref}^{commit}" >/dev/null; then
441443
git -C "$repo_dir" checkout --detach "$ref"
442444
return 0
@@ -445,6 +447,18 @@ checkout_git_openclaw_ref() {
445447
fail "Requested git version not found: ${ref}"
446448
}
447449

450+
git_install_lockfile_flag() {
451+
local repo_dir="$1"
452+
local ref="$2"
453+
454+
if [[ "$ref" == "main" ]] || git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
455+
echo "--no-frozen-lockfile"
456+
return 0
457+
fi
458+
459+
echo "--frozen-lockfile"
460+
}
461+
448462
repo_pnpm_spec() {
449463
local repo_dir="$1"
450464
local package_json="${repo_dir}/package.json"
@@ -723,7 +737,9 @@ install_openclaw_from_git() {
723737
ensure_pnpm_git_prepare_allowlist "$repo_dir"
724738
activate_repo_pnpm_version "$repo_dir"
725739

726-
SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_pnpm -C "$repo_dir" install --frozen-lockfile
740+
local install_lockfile_flag
741+
install_lockfile_flag="$(git_install_lockfile_flag "$repo_dir" "$git_ref")"
742+
CI="${CI:-true}" SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_pnpm -C "$repo_dir" install "$install_lockfile_flag"
727743

728744
if ! run_pnpm -C "$repo_dir" ui:build; then
729745
log "UI build failed; continuing (CLI may still work)"

public/install.sh

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,29 +1960,31 @@ checkout_git_openclaw_ref() {
19601960
return 0
19611961
fi
19621962

1963-
run_quiet_step "Fetching requested version" git -C "$repo_dir" fetch --tags origin
1964-
19651963
if [[ "$ref" == "main" ]]; then
1964+
run_quiet_step "Fetching requested version" git -C "$repo_dir" fetch --no-tags origin main
19661965
run_quiet_step "Checking out main" git -C "$repo_dir" checkout main
19671966
if [[ "$GIT_UPDATE" == "1" ]]; then
1968-
run_quiet_step "Updating repository" git -C "$repo_dir" pull --rebase || true
1967+
run_quiet_step "Updating repository" git -C "$repo_dir" pull --rebase --no-tags || true
19691968
fi
19701969
return 0
19711970
fi
19721971

1973-
if git -C "$repo_dir" rev-parse --verify --quiet "refs/tags/${ref}^{commit}" >/dev/null; then
1974-
run_quiet_step "Checking out ${ref}" git -C "$repo_dir" checkout --detach "$ref"
1975-
return 0
1976-
fi
1977-
19781972
if git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
1973+
run_quiet_step "Fetching requested version" git -C "$repo_dir" fetch --no-tags origin "refs/heads/${ref}:refs/remotes/origin/${ref}"
19791974
run_quiet_step "Checking out ${ref}" git -C "$repo_dir" checkout -B "$ref" "origin/$ref"
19801975
if [[ "$GIT_UPDATE" == "1" ]]; then
1981-
run_quiet_step "Updating repository" git -C "$repo_dir" pull --rebase || true
1976+
run_quiet_step "Updating repository" git -C "$repo_dir" pull --rebase --no-tags || true
19821977
fi
19831978
return 0
19841979
fi
19851980

1981+
run_quiet_step "Fetching requested version" git -C "$repo_dir" fetch --tags origin
1982+
1983+
if git -C "$repo_dir" rev-parse --verify --quiet "refs/tags/${ref}^{commit}" >/dev/null; then
1984+
run_quiet_step "Checking out ${ref}" git -C "$repo_dir" checkout --detach "$ref"
1985+
return 0
1986+
fi
1987+
19861988
if git -C "$repo_dir" rev-parse --verify --quiet "${ref}^{commit}" >/dev/null; then
19871989
run_quiet_step "Checking out ${ref}" git -C "$repo_dir" checkout --detach "$ref"
19881990
return 0
@@ -1992,6 +1994,18 @@ checkout_git_openclaw_ref() {
19921994
return 1
19931995
}
19941996

1997+
git_install_lockfile_flag() {
1998+
local repo_dir="$1"
1999+
local ref="$2"
2000+
2001+
if [[ "$ref" == "main" ]] || git -C "$repo_dir" ls-remote --exit-code --heads origin "$ref" >/dev/null 2>&1; then
2002+
echo "--no-frozen-lockfile"
2003+
return 0
2004+
fi
2005+
2006+
echo "--frozen-lockfile"
2007+
}
2008+
19952009
repo_pnpm_spec() {
19962010
local repo_dir="$1"
19972011
local package_json="${repo_dir}/package.json"
@@ -2368,7 +2382,9 @@ install_openclaw_from_git() {
23682382
cleanup_legacy_submodules "$repo_dir"
23692383
activate_repo_pnpm_version "$repo_dir"
23702384

2371-
SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_quiet_step "Installing dependencies" run_pnpm -C "$repo_dir" install --frozen-lockfile
2385+
local install_lockfile_flag
2386+
install_lockfile_flag="$(git_install_lockfile_flag "$repo_dir" "$git_ref")"
2387+
CI="${CI:-true}" SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_quiet_step "Installing dependencies" run_pnpm -C "$repo_dir" install "$install_lockfile_flag"
23722388

23732389
if ! run_quiet_step "Building UI" run_pnpm -C "$repo_dir" ui:build; then
23742390
ui_warn "UI build failed; continuing (CLI may still work)"

0 commit comments

Comments
 (0)