Skip to content

Commit

Permalink
Make build script as alias of prepublish
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 2, 2019
1 parent d6c973a commit a56eb11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"prettier": "prettier --write --list-different 'src/**/*.js'",
"check": "flow check",
"check-cover": "flow batch-coverage --quiet --strip-root --show-all src/ && flow stop --quiet",
"build": "node resources/build.js",
"build": "npm run prepare",
"prepare": "node resources/build.js",
"preversion": ". ./resources/checkgit.sh && npm test",
"prepublishOnly": ". ./resources/prepublish.sh",
"gitpublish": ". ./resources/gitpublish.sh"
Expand Down
7 changes: 6 additions & 1 deletion resources/prepublish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ if [ "$CI" != true ]; then
exit 1;
fi;

if [ ! -d "./dist" ]; then
echo "\n\n\n \033[101;30m Directory 'dist' does not exists. \033[0m" 1>&2;
echo " Ensure that you run build script before running this one." 1>&2;
exit 1;
fi;

# When Travis CI publishes to NPM, the published files are available in the root
# directory, which allows for a clean include or require of sub-modules.
npm run build
cp -r ./dist/* ./

0 comments on commit a56eb11

Please sign in to comment.