8000 [pkg] add script for linux/macos · EvsChen/leetcode-cli@98d9a2f · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 98d9a2f

Browse files
committed
[pkg] add script for linux/macos
* refs skygragon#133 Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent 465b3c3 commit 98d9a2f

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

bin/pkg

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
plugins="company cookie.chrome cookie.firefox cpp.lint cpp.run github leetcode.cn lintcode solution.discuss"
4+
5+
for plugin in $plugins; do
6+
echo "[$plugin]"
7+
./bin/leetcode ext -i $plugin
8+
done
9+
10+
ver=`node -v | sed 's/^v//' | awk -F. '{print $1}'`
11+
case `uname` in
12+
Linux) os=linux ;;
13+
Darwin) os=macos ;;
14+
*) echo "OS not supported!" && exit 1
15+
esac
16+
case `uname -m` in
17+
x86_64) arch=x64 ;;
18+
i?86) arch=x32 ;;
19+
*) echo "Arch not supported!" && exit 1
20+
esac
21+
22+
rm -rf dist/*
23+
find node_modules -name "*.node" -exec cp {} dist/ \;
24+
npm run pkg -- node$ver-$os-$arch
25+
tar zcvf leetcode-cli.$os.tar.gz dist/

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"scripts": {
1313
"lint": "eslint lib/ test/",
1414
"test": "npm run lint && nyc mocha test/** && nyc report --reporter=lcov",
15-
"pkg": "pkg . --out-path=dist/"
15+
"pkg": "pkg . --out-path=dist/ --targets"
1616
},
1717
"pkg": {
1818
"scripts": [

0 commit comments

Comments
 (0)
0