mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 22:15:33 +00:00
fix(ci): validate cached ui dependencies
This commit is contained in:
1 parent
f345cf441e
commit
02747edb72
4 files changed
+31
-15
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
UI_DIR="$ROOT_DIR/ui"
|
||||
UI_SENTINEL="$UI_DIR/node_modules/@date-fns/tz/date/mini.js"
|
||||
|
||||
ensure_root_deps() {
|
||||
if [[ ! -d "$ROOT_DIR/node_modules" ]]; then
|
||||
echo "[deps] Installing root dependencies"
|
||||
(cd "$ROOT_DIR" && bun install --frozen-lockfile)
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_ui_deps() {
|
||||
if [[ -d "$UI_DIR/node_modules" && -f "$UI_SENTINEL" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo "[deps] Reinstalling UI dependencies"
|
||||
rm -rf "$UI_DIR/node_modules"
|
||||
(cd "$UI_DIR" && bun install --frozen-lockfile)
|
||||
}
|
||||
|
||||
ensure_root_deps
|
||||
ensure_ui_deps
|
||||
Reference in new issue
Block a user