mirror of
https://github.com/imjasonh/apidiff-action
synced 2026-07-06 22:52:43 +00:00
- Check if already on Node 20 before trying to use nvm - This fixes CI where nvm is not available but Node 20 is already set
15 lines
400 B
Bash
Executable file
15 lines
400 B
Bash
Executable file
#!/bin/bash
|
|
# Pre-commit script to check if dist is up to date
|
|
|
|
# Try to use Node 20 via nvm if available
|
|
export NVM_DIR="$HOME/.nvm"
|
|
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
. "$NVM_DIR/nvm.sh"
|
|
nvm use 20.9.0 >/dev/null 2>&1
|
|
fi
|
|
|
|
# Check if dist has uncommitted changes
|
|
if [ -n "$(git status --porcelain dist)" ]; then
|
|
echo "dist is out of date. Run npm run build and commit the changes."
|
|
exit 1
|
|
fi
|