File tree Expand file tree Collapse file tree 3 files changed +23
-13
lines changed Expand file tree Collapse file tree 3 files changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,4 @@ if (os === 'darwin') {
1717var proc = require ( 'child_process' ) . spawn ( bin , args ) ;
1818proc . stdout . on ( 'data' , x => console . log ( x . toString ( ) . trimRight ( '\n' ) ) ) ;
1919proc . stderr . on ( 'data' , x => console . log ( x . toString ( ) . trimRight ( '\n' ) ) ) ;
20+ proc . on ( 'close' , process . exit ) ;
Original file line number Diff line number Diff line change @@ -3,17 +3,23 @@ set arch=%1
33set os = %2
44set ver = %3
55
6+ set dist = dist\
7+ set file = leetcode-cli.node%ver% .%os% .%arch% .zip
8+
9+ mkdir %dist%
10+ del /q %dist% \*
11+ del /q *.zip
12+
613for %%x in (company cookie.chrome cookie.firefox cpp.lint cpp.run github leetcode.cn lintcode solution.discuss) do (
714 echo [%%x ]
815 node bin\leetcode ext -i %%x
16+ if %ERRORLEVEL% gtr 0 exit /b 1
917)
1018
11- set dist = dist\
12- mkdir %dist%
13- del /q %dist% \*
14-
1519for /r . %%x in (*.node) do copy %%x %dist%
16- npm run pkg -- node%ver% -%os% -%arch%
20+ call npm run pkg -- node%ver% -%os% -%arch%
21+ if %ERRORLEVEL% gtr 0 exit /b 1
1722
18- set file = leetcode-cli.node%ver% .%os% .%arch% .zip
19- 7z a %file% %dist%
23+ 7z a %file% %dist%
24+ if %ERRORLEVEL% gtr 0 exit /b 1
25+ exit 0
Original file line number Diff line number Diff line change @@ -4,20 +4,23 @@ arch=$1
44os=$2
55ver=$3
66
7+ DIST=./dist
8+ FILE=leetcode-cli.node$ver .$os .$arch .tar.gz
9+
10+ mkdir -p $DIST
11+ rm -rf $DIST /*
12+ rm -rf $FILE
13+
714plugins=" company cookie.chrome cookie.firefox cpp.lint cpp.run github leetcode.cn lintcode solution.discuss"
815
916for plugin in $plugins ; do
1017 echo " [$plugin ]"
1118 ./bin/leetcode ext -i $plugin
1219done
1320
14- DIST=./dist
15- mkdir -p $DIST
16- rm -rf $DIST /*
17-
1821find node_modules -name " *.node" -exec cp {} $DIST \;
1922npm run pkg -- node$ver -$os -$arch
2023
21- FILE=leetcode-cli.node$ver .$os .$arch .tar.gz
22- tar zcvf $FILE $DIST
24+ tar zcvf $FILE $DIST
2325ls -al $FILE
26+ exit 0
You can’t perform that action at this time.
0 commit comments