Skip to content

Commit

Permalink
Run browserify and copy after install
Browse files Browse the repository at this point in the history
  • Loading branch information
n4bb12 authored and sharkdp committed Oct 12, 2018
1 parent 25251a3 commit e747545
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 21 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Expand Up @@ -8,7 +8,4 @@
/.psa*
/docs/insect.1
insect.js
/web/jquery.min.js
/web/jquery.mousewheel-min.js
/web/jquery.terminal.min.js
/web/keyboardevent-key-polyfill.js
/web/*.js
8 changes: 1 addition & 7 deletions build.sh
@@ -1,13 +1,7 @@
#!/bin/bash

npm run browserify

cp insect.js web/

cp bower_components/keyboardevent-key-polyfill/index.js web/keyboardevent-key-polyfill.js
cp bower_components/jquery.terminal/js/jquery.terminal-1.6.3.min.js web/jquery.terminal.min.js
cp bower_components/jquery/dist/jquery.min.js web/
cp bower_components/jquery.terminal/js/jquery.mousewheel-min.js web/
npm run copy

if [[ $* == *--nexe* ]]
then
Expand Down
22 changes: 22 additions & 0 deletions copy.js
@@ -0,0 +1,22 @@
const fs = require("fs-extra")

fs.copySync(
"insect.js",
"web/insect.js",
)
fs.copySync(
"bower_components/keyboardevent-key-polyfill/index.js",
"web/keyboardevent-key-polyfill.js",
)
fs.copySync(
"bower_components/jquery/dist/jquery.min.js",
"web/jquery.min.js",
)
fs.copySync(
"bower_components/jquery.terminal/js/jquery.terminal-1.6.3.min.js",
"web/jquery.terminal.min.js",
)
fs.copySync(
"bower_components/jquery.terminal/js/jquery.mousewheel-min.js",
"web/jquery.mousewheel-min.js",
)
46 changes: 37 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -17,7 +17,8 @@
"test": "test"
},
"scripts": {
"postinstall": "bower install && npm run build",
"postinstall": "bower install && npm run browserify && npm run copy",
"copy": "node copy",
"start": "run-p server browserify:watch",
"browserify:watch": "pulp -w browserify --skip-entry-point -m Insect --standalone Insect -O -t insect.js",
"browserify": "pulp browserify --skip-entry-point -m Insect --standalone Insect -O -t insect.js",
Expand All @@ -36,6 +37,7 @@
},
"devDependencies": {
"bower": "^1.8.4",
"fs-extra": "^7.0.0",
"live-server": "^1.2.0",
"npm-run-all": "^4.1.3",
"pulp": "^12.3.0",
Expand Down

0 comments on commit e747545

Please sign in to comment.