ci: fix npm run (#4849)

pull/4850/head^2
James Elliott 2023-01-30 09:59:32 +11:00 committed by GitHub
parent 8acc1053ed
commit 74e5272f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 13 deletions

View File

@ -11,6 +11,10 @@ insert_final_newline = true
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
[{.github/pre-commit,.github/required-apps,.github/commit-msg}]
indent_style = space
indent_size = 2
[.buildkite/hooks/**] [.buildkite/hooks/**]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

3
.github/commit-msg vendored
View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/required-apps" . "$(dirname "$0")/required-apps"
cd web && ${PMGR} commitlint --edit "$1" cd web && ${PMGR_EXEC} commitlint --edit "$1"

2
.github/pre-commit vendored
View File

@ -8,4 +8,4 @@ fi
. "$(dirname "$0")/required-apps" . "$(dirname "$0")/required-apps"
golangci-lint run -v --fix && \ golangci-lint run -v --fix && \
cd web && "${PMGR}" lint cd web && ${PMGR_RUN} lint

21
.github/required-apps vendored
View File

@ -1,19 +1,20 @@
#!/bin/sh #!/bin/sh
export PMGR=pnpm
if [ ! -x "$(command -v golangci-lint)" ]; then if [ ! -x "$(command -v golangci-lint)" ]; then
echo "You must install golangci-lint." echo "You must install golangci-lint."
exit 1 exit 1
fi fi
if [ ! -x "$(command -v pnpm)" ]; then if [ -x "$(command -v pnpm)" ]; then
export PMGR=yarn export PMGR_RUN="pnpm"
if [ ! -x "$(command -v yarn)" ]; then export PMGR_EXEC="pnpm"
export PMGR=npm elif [ -x "$(command -v yarn)" ]; then
if [ ! -x "$(command -v npm)" ]; then export PMGR_RUN="yarn run"
echo "You must install a node package manager." 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 exit 1
fi fi
fi
fi