File tree Expand file tree Collapse file tree 5 files changed +44
-14
lines changed Expand file tree Collapse file tree 5 files changed +44
-14
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,4 @@ jspm_packages
3838
3939tmp /
4040.DS_Store
41+ .env.json
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ ENVFILE=.env.json
4+
5+ check () {
6+ printf " Checking $1 ... "
7+ $1 --version > /dev/null 2>&1
8+ if [ $? != 0 ]; then
9+ echo " No"
10+ echo " [ERROR] Missing $1 !"
11+ exit 1;
12+ fi
13+ echo " Yes"
14+ }
15+
16+ create () {
17+ cat << EOF > $1
18+ {
19+ "commit": {
20+ "full": "` git rev-parse HEAD` ",
21+ "short": "` git rev-parse --short HEAD` "
22+ },
23+ "node": "` node -v` ",
24+ "npm": "` npm -v` "
25+ }
26+ EOF
27+ }
28+
29+ check git
30+ check node
31+ check npm
32+
33+ create $ENVFILE
34+
35+ npm install
36+ echo " You might need root privilege to install globally ... "
37+ sudo npm install -g .
38+
39+ rm $ENVFILE
40+
41+ echo " leetcode-cli successfully installed."
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ Choose one of the following ways to install leetcode-cli:
2626** From source code**
2727
2828 $ git clone http://github.com/skygragon/leetcode-cli
29- $ cd leetcode-cli && npm install && sudo npm install -g --unsafe-perm .
29+ $ cd leetcode-cli && ./bin/install
3030
3131Then verify the result:
3232
Original file line number Diff line number Diff line change 88 },
99 "scripts" : {
1010 "lint" : " eslint lib/ test/" ,
11- "test" : " npm run lint && nyc mocha test/" ,
12- "prepare" : " ./bin/prepare"
11+ "test" : " npm run lint && nyc mocha test/"
1312 },
1413 "repository" : {
1514 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments