Skip to content

Commit

Permalink
Merge pull request #102 from Unleash/feat/test-release-script
Browse files Browse the repository at this point in the history
feat: add script to check if release is ok
  • Loading branch information
FredrikOseberg authored Aug 10, 2022
2 parents 5d2b8aa + c58593e commit 0b8b514
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",
"build:ts": "tsc",
"build:web": "rollup -c rollup.config.js",
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=$(grep '"main"' ./package.json | 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 0b8b514

Please sign in to comment.