Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit f9b80fc

Browse files
authored
Merge pull request #387 from wincent/glh/travis-alt-fix
Force install before build to fix Travis NPM deploys
2 parents f468f29 + bb8b2a6 commit f9b80fc

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"testonly": "mocha $npm_package_options_mocha",
4848
"lint": "eslint src",
4949
"check": "flow check",
50-
"build": "rm -rf dist/* && node_modules/.bin/babel src --ignore __tests__ --out-dir dist && npm run build:flow",
50+
"build": "rm -rf dist/* && babel src --ignore __tests__ --out-dir dist && npm run build:flow",
5151
"build:flow": "find ./src -name '*.js' -not -path '*/__tests__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/dist\\//g'`.flow; done",
5252
"watch": "node resources/watch.js",
5353
"cover": "babel-node node_modules/.bin/isparta cover --root src --report html node_modules/.bin/_mocha -- $npm_package_options_mocha",

resources/prepublish.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22
# prepublish runs after `npm install` and `npm pack`.
33
# In order to only run prepublish before `npm publish`, we have to check argv.
44
if node -e "process.exit(($npm_config_argv).original[0].indexOf('pu') === 0)"; then
5-
exit 0;
5+
exit 0
66
fi
77

88
# Publishing to NPM is currently supported by Travis CI, which ensures that all
99
# tests pass first and the deployed module contains the correct file struture.
1010
# In order to prevent inadvertently circumventing this, we ensure that a CI
1111
# environment exists before continuing.
1212
if [ "$CI" != true ]; then
13-
echo "\n\n\n \033[101;30m Only Travis CI can publish to NPM. \033[0m" 1>&2;
14-
echo " Ensure git is left is a good state by backing out any commits and deleting any tags." 1>&2;
15-
echo " Then read CONTRIBUTING.md to learn how to publish to NPM.\n\n\n" 1>&2;
16-
exit 1;
17-
fi;
13+
echo "\n\n\n \033[101;30m Only Travis CI can publish to NPM. \033[0m" 1>&2
14+
echo " Ensure git is left is a good state by backing out any commits and deleting any tags." 1>&2
15+
echo " Then read CONTRIBUTING.md to learn how to publish to NPM.\n\n\n" 1>&2
16+
exit 1
17+
fi
1818

1919
# Build before Travis CI publishes to NPM
20-
npm run build;
20+
npm install
21+
npm run build

0 commit comments

Comments
 (0)