This repository was archived by the owner on May 15, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
12branch=" $( git rev-parse --abbrev-ref HEAD) "
23
34if [ " $branch " = " main" ]; then
45 echo " You can't commit directly to main - please check out a branch."
56 exit 1
67fi
78
8- # Detect if running on Windows and use pnpm.cmd, otherwise use pnpm.
9- if [ "$OS" = "Windows_NT" ]; then
10- pnpm_cmd="pnpm.cmd"
11- else
12- if command -v pnpm >/dev/null 2>&1; then
13- pnpm_cmd="pnpm"
14- else
15- pnpm_cmd="npx pnpm"
16- fi
17- fi
18-
19- # Detect if running on Windows and use npx.cmd, otherwise use npx.
20- if [ "$OS" = "Windows_NT" ]; then
21- npx_cmd="npx.cmd"
22- else
23- npx_cmd="npx"
24- fi
25-
26- $npx_cmd lint-staged
27- $pnpm_cmd lint
9+ # Use npx to run lint-staged and pnpm for lint
10+ # Git Bash on Windows automatically resolves pnpm to pnpm.cmd
11+ npx lint-staged
12+ pnpm lint
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
12branch=" $( git rev-parse --abbrev-ref HEAD) "
23
34if [ " $branch " = " main" ]; then
45 echo " You can't push directly to main - please check out a branch."
56 exit 1
67fi
78
8- # Detect if running on Windows and use pnpm.cmd, otherwise use pnpm.
9- if [ "$OS" = "Windows_NT" ]; then
10- pnpm_cmd="pnpm.cmd"
11- else
12- if command -v pnpm >/dev/null 2>&1; then
13- pnpm_cmd="pnpm"
14- else
15- pnpm_cmd="npx pnpm"
16- fi
17- fi
18-
19- $pnpm_cmd run check-types
9+ # Git Bash on Windows automatically resolves pnpm to pnpm.cmd
10+ pnpm run check-types
2011
2112# Use dotenvx to securely load .env.local and run commands that depend on it
2213if [ -f " .env.local" ]; then
2314 # Check if RUN_TESTS_ON_PUSH is set to true and run tests with dotenvx
2415 if npx dotenvx get RUN_TESTS_ON_PUSH -f .env.local 2> /dev/null | grep -q " ^true$" ; then
25- npx dotenvx run -f .env.local -- $pnpm_cmd run test
16+ npx dotenvx run -f .env.local -- pnpm run test
2617 fi
2718else
2819 # Fallback: run tests if RUN_TESTS_ON_PUSH is set in regular environment
2920 if [ " $RUN_TESTS_ON_PUSH " = " true" ]; then
30- $pnpm_cmd run test
21+ pnpm run test
3122 fi
3223fi
3324
You can’t perform that action at this time.
0 commit comments