ci: fix pre-commit scripts compatibility with posix shells (#4243)
Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>pull/4335/head
parent
606875ea39
commit
548bdce8ba
|
@ -1,7 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$NO_HOOK" ]]
|
||||
then
|
||||
if [ -n "$NO_HOOK" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -9,4 +8,4 @@ fi
|
|||
. "$(dirname "$0")/required-apps"
|
||||
|
||||
golangci-lint run -v --fix && \
|
||||
cd web && ${PMGR} lint
|
||||
cd web && "${PMGR}" lint
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
PMGR=pnpm
|
||||
export PMGR=pnpm
|
||||
|
||||
if [[ ! -x "$(command -v golangci-lint)" ]]; then
|
||||
if [ ! -x "$(command -v golangci-lint)" ]; then
|
||||
echo "You must install golangci-lint."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x "$(command -v pnpm)" ]]; then
|
||||
PMGR=yarn
|
||||
if [[ ! -x "$(command -v yarn)" ]]; then
|
||||
PMGR=npm
|
||||
if [[ ! -x "$(command -v npm)" ]]; then
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue