Skip to content

Commit f28421f

Browse files
committed
fix(installer): call run_pnpm correctly in git install
1 parent 836ea64 commit f28421f

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

public/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ install_openclaw_from_git() {
14511451

14521452
cleanup_legacy_submodules "$repo_dir"
14531453

1454-
run_quiet_step "Installing dependencies" env SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_pnpm -C "$repo_dir" install
1454+
SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" run_quiet_step "Installing dependencies" run_pnpm -C "$repo_dir" install
14551455

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

scripts/test-install-sh-unit.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,46 @@ EOF
227227
assert_eq "${PNPM_CMD[*]}" "pnpm" "ensure_pnpm (npm fallback)"
228228
)
229229

230+
echo "==> case: install_openclaw_from_git (deps step uses run_pnpm function)"
231+
(
232+
root="${TMP_DIR}/case-install-git-deps"
233+
repo="${root}/repo"
234+
home_dir="${root}/home"
235+
236+
mkdir -p "${repo}/.git" "${repo}/dist" "${home_dir}"
237+
: > "${repo}/dist/entry.js"
238+
239+
export HOME="${home_dir}"
240+
GIT_UPDATE=0
241+
SHARP_IGNORE_GLOBAL_LIBVIPS=1
242+
243+
deps_called=0
244+
deps_cmd=""
245+
246+
check_git() { return 0; }
247+
install_git() { fail "install_git should not be called"; }
248+
ensure_pnpm() { :; }
249+
cleanup_legacy_submodules() { :; }
250+
ensure_user_local_bin_on_path() { mkdir -p "${HOME}/.local/bin"; }
251+
run_pnpm() { :; }
252+
ui_info() { :; }
253+
ui_success() { :; }
254+
ui_warn() { :; }
255+
ui_error() { :; }
256+
257+
run_quiet_step() {
258+
local _title="$1"
259+
shift
260+
if [[ "${_title}" == "Installing dependencies" ]]; then
261+
deps_called=1
262+
deps_cmd="${1:-}"
263+
fi
264+
"$@" >/dev/null 2>&1 || true
265+
}
266+
267+
install_openclaw_from_git "${repo}"
268+
assert_eq "$deps_called" "1" "install_openclaw_from_git dependencies step"
269+
assert_eq "$deps_cmd" "run_pnpm" "install_openclaw_from_git dependencies command"
270+
)
271+
230272
echo "OK"

0 commit comments

Comments
 (0)