Skip to content

Commit

Permalink
feat: add .nvmrc + bash script to restrict node version
Browse files Browse the repository at this point in the history
  • Loading branch information
acd02 committed Feb 7, 2023
1 parent c0c1e81 commit cb7cd0b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.11.0
9 changes: 9 additions & 0 deletions check-nvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

expected_version="v$(cat .nvmrc)"
installed_version=$(node -v)

if [ "$expected_version" != "$installed_version" ]; then
echo "Node version expected was $expected_version, but got $installed_version"
exit 1
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "storybook dev -p 6006",
"start": "sh check-nvm.sh && storybook dev -p 6006",
"build": "tsc && vite build",
"preview": "vite preview",
"build-storybook": "storybook build",
Expand Down

0 comments on commit cb7cd0b

Please sign in to comment.