File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ var exec = require ( 'child_process' ) . exec ;
2+ var ghpages = require ( 'gh-pages' ) ;
3+ var loading = require ( 'loading-cli' ) ;
4+ var path = require ( 'path' ) ;
5+ var color = require ( 'colors-cli/safe' ) ;
6+ var error = color . red . bold ;
7+ var warn = color . yellow ;
8+ var notice = color . blue ;
9+ var success = color . green ;
10+
11+ var deploy_path = path . join ( process . cwd ( ) , '.deploy' ) ;
12+
13+ if ( fs . existsSync ( deploy_path ) ) {
14+ var load = loading ( ' Pushing code!!' )
15+ load . start ( ) ;
16+ ghpages . publish ( deploy_path , {
17+ repo : 'https://github.com/jaywcjlove/linux-command.git' ,
18+ branch : 'gh-pages'
19+ } , function ( err ) {
20+ if ( err ) return console . log ( error ( ' → ' + "ok!" + err ) ) ;
21+ load . stop ( )
22+ console . log ( success ( '\n\n ' + "Push success!!" ) ) ;
23+ // 删除文件夹
24+ exec ( 'rm -rf .deploy' ) ;
25+ } ) ;
26+ }
Original file line number Diff line number Diff line change 66 "scripts" : {
77 "test" : " echo \" Error: no test specified\" && exit 1" ,
88 "start" : " node build/compile.js" ,
9+ "deploy" : " node build/deploy.js" ,
910 "build:css" : " stylus -u autoprefixer-stylus template/styl/index.styl -o .deploy/ -c" ,
1011 "watch:css" : " stylus -u autoprefixer-stylus -w template/styl/index.styl -o .deploy/ -c"
1112 },
2930 "ssr" : " ^1.1.1" ,
3031 "stylus" : " ^0.54.5" ,
3132 "watch" : " ^1.0.1"
33+ },
34+ "dependencies" : {
35+ "gh-pages" : " ^0.12.0" ,
36+ "loading-cli" : " ^1.0.2"
3237 }
3338}
You can’t perform that action at this time.
0 commit comments