ci: fix npm run (#4849)
parent
8acc1053ed
commit
74e5272f33
|
@ -11,6 +11,10 @@ insert_final_newline = true
|
|||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[{.github/pre-commit,.github/required-apps,.github/commit-msg}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[.buildkite/hooks/**]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
. "$(dirname "$0")/required-apps"
|
||||
|
||||
cd web && ${PMGR} commitlint --edit "$1"
|
||||
cd web && ${PMGR_EXEC} commitlint --edit "$1"
|
||||
|
|
|
@ -8,4 +8,4 @@ fi
|
|||
. "$(dirname "$0")/required-apps"
|
||||
|
||||
golangci-lint run -v --fix && \
|
||||
cd web && "${PMGR}" lint
|
||||
cd web && ${PMGR_RUN} lint
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
export PMGR=pnpm
|
||||
|
||||
if [ ! -x "$(command -v golangci-lint)" ]; then
|
||||
echo "You must install golangci-lint."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -x "$(command -v pnpm)" ]; then
|
||||
export PMGR=yarn
|
||||
if [ ! -x "$(command -v yarn)" ]; then
|
||||
export PMGR=npm
|
||||
if [ ! -x "$(command -v npm)" ]; then
|
||||
echo "You must install a node package manager."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -x "$(command -v pnpm)" ]; then
|
||||
export PMGR_RUN="pnpm"
|
||||
export PMGR_EXEC="pnpm"
|
||||
elif [ -x "$(command -v yarn)" ]; then
|
||||
export PMGR_RUN="yarn run"
|
||||
export PMGR_EXEC="yarn dlx"
|
||||
elif [ -x "$(command -v npm)" ]; then
|
||||
export PMGR_RUN="npm run"
|
||||
export PMGR_EXEC="npx"
|
||||
else
|
||||
echo "You must install a node package manager (pnpm, yarn, or npm)."
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue