-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpm_scripts.sh
More file actions
executable file
·93 lines (90 loc) · 2.14 KB
/
Copy pathnpm_scripts.sh
File metadata and controls
executable file
·93 lines (90 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
# jslint-utility2
shMain() {(set -e
# this function will run the main program
# run command custom
case "$1" in
esac
# run command default
case "$1" in
build-ci)
if [ "$npm_package_nameLib" = utility2 ]
then
./lib.utility2.sh shReadmeTest build_ci.sh
return
fi
utility2 shReadmeTest build_ci.sh
;;
heroku-postbuild)
if [ "$npm_package_nameLib" = utility2 ]
then
./lib.utility2.sh shDeployHeroku
return
fi
npm install kaizhu256/node-utility2#alpha --prefix .
utility2 shDeployHeroku
;;
eval)
shift
"$@"
;;
start)
export PORT=${PORT:-8080}
if [ -f assets.app.js ]
then
node assets.app.js
else
if [ "$npm_package_nameLib" = utility2 ]
then
export npm_config_mode_auto_restart=1
./lib.utility2.sh shRun shIstanbulCover test.js
return
fi
utility2 start test.js
fi
;;
test)
if [ "$npm_package_nameLib" = utility2 ]
then
export PORT=$(./lib.utility2.sh shServerPortRandom)
export PORT_REPL=$(./lib.utility2.sh shServerPortRandom)
export npm_config_mode_auto_restart=1
export npm_config_timeout_default=60000
./lib.utility2.sh test test.js
return
fi
export PORT=$(utility2 shServerPortRandom)
utility2 test test.js
;;
utility2)
shift
if [ "$npm_package_nameLib" = utility2 ]
then
./lib.utility2.sh "$@"
return
fi
utility2 "$@"
;;
esac
)}
# run command
eval shMain "$npm_lifecycle_event" "$(node -e "
// <script>
/* jslint-utility2 */
/*jslint
bitwise: true,
browser: true,
maxerr: 4,
maxlen: 100,
node: true,
nomen: true,
regexp: true,
stupid: true
*/
'use strict';
console.log(
JSON.parse(process.env.npm_config_argv).original.join(' ').replace((/^(?:run )?\S+ /), '')
);
// </script>
"
)"