mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 06:33:37 +08:00
fix: 增加pnpm store-dir探测日志并修复grep命令失败时的错误
This commit is contained in:
@@ -111,7 +111,7 @@ runs:
|
||||
return
|
||||
fi
|
||||
local raw
|
||||
raw=$(grep -E '^[[:space:]]*store-dir[[:space:]]*=' "$file" | tail -n1 | cut -d= -f2-)
|
||||
raw=$(grep -E '^[[:space:]]*store-dir[[:space:]]*=' "$file" | tail -n1 | cut -d= -f2- || true)
|
||||
if [[ -z "$raw" ]]; then
|
||||
return
|
||||
fi
|
||||
@@ -129,8 +129,11 @@ runs:
|
||||
}
|
||||
|
||||
probe_config "${NPM_CONFIG_USERCONFIG:-}"
|
||||
echo "ℹ️ Checked userconfig: ${NPM_CONFIG_USERCONFIG:-<unset>} -> ${STORE_DIR_CANDIDATE:-<none>}"
|
||||
probe_config ".npmrc"
|
||||
echo "ℹ️ Checked project .npmrc -> ${STORE_DIR_CANDIDATE:-<none>}"
|
||||
probe_config "$HOME/.npmrc"
|
||||
echo "ℹ️ Checked home .npmrc -> ${STORE_DIR_CANDIDATE:-<none>}"
|
||||
|
||||
if [[ -z "$STORE_DIR_CANDIDATE" ]]; then
|
||||
STORE_DIR_CANDIDATE=$(pnpm store path --silent 2>/dev/null || true)
|
||||
@@ -141,6 +144,8 @@ runs:
|
||||
STORE_DIR_CANDIDATE="$DEFAULT_STORE"
|
||||
fi
|
||||
|
||||
echo "ℹ️ Final store candidate: $STORE_DIR_CANDIDATE"
|
||||
|
||||
mkdir -p "$STORE_DIR_CANDIDATE"
|
||||
|
||||
case "$STORE_DIR_CANDIDATE" in
|
||||
|
Reference in New Issue
Block a user