Skip to content

Commit

Permalink
feat: add script to check if release is ok
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg committed Aug 10, 2022
1 parent 856240c commit 2c53fd1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"scripts": {
"preversion": "rm -rf build && npm run build",
"prepare": "npm run build",
"prepare": "npm run build && ./scripts/check-release.sh",
"build": "npm run build:ts && npm run build:web",
"lint": "eslint ./src",
"build:ts": "tsc",
Expand Down
11 changes: 11 additions & 0 deletions scripts/check-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Get the main field from package.json
FILE=$(cat ./package.json | grep main | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')

# test the path to see if the file exists
if test -f "$FILE"; then
echo "Release is OK"
else
echo "Release is NOT ok because the file specified as main in package.json at path ${FILE} does not exist"
exit 1
fi

0 comments on commit 2c53fd1

Please sign in to comment.