Skip to content

Commit

Permalink
Add safeguard postinstall script prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
calzoneman committed Sep 24, 2015
1 parent 0109a87 commit 2b6e58a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
14 changes: 14 additions & 0 deletions NEWS.md
@@ -1,3 +1,17 @@
2015-09-21
==========

* CyTube is now transpiled with [babel] to allow the use of ES6/ES2015
features. All source files have been moved from `lib` to `src`.
* Running `npm install` or `npm run postinstall` will prompt you to
build from `src` to `lib`.
* Running `npm run build-server` will run the build script without any
prompts.
* After updating with `git pull`, you should run `npm install` or `npm run
build-server` in order to rebuild after the changes.

[babel]: https://babeljs.io/

2015-07-25 2015-07-25
========== ==========


Expand Down
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -36,9 +36,10 @@
"yamljs": "^0.1.6" "yamljs": "^0.1.6"
}, },
"scripts": { "scripts": {
"postinstall": "babel --source-maps --out-dir lib/ src/", "build-player": "$npm_node_execpath build-player.js",
"build-watch": "babel --watch --source-maps --out-dir lib/ src/", "build-server": "babel --source-maps --out-dir lib/ src/",
"build-player": "$npm_node_execpath build-player.js" "postinstall": "./postinstall.sh",
"server-dev": "babel --watch --source-maps --out-dir lib/ src/"
}, },
"devDependencies": { "devDependencies": {
"coffee-script": "^1.9.2" "coffee-script": "^1.9.2"
Expand Down
13 changes: 13 additions & 0 deletions postinstall.sh
@@ -0,0 +1,13 @@
#!/bin/sh

echo "In order to run the server, the source files in src/ must be transpiled to lib/. This will overwrite any changes you have made to the files in lib/."
echo -n "Do you want to build now? [y/N]? "
read answer
echo

if test "$answer" = "y" || test "$answer" = "Y"; then
echo "Running $npm_package_scripts_build_server"
$npm_package_scripts_build_server
else
echo "Skipping build step. You can build at a later time by running \`npm run build-server\`."
fi

0 comments on commit 2b6e58a

Please sign in to comment.