File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 2525 "watch" : " karma start --singleRun=false --autoWatch=true --autoWatchInterval=1" ,
2626 "debug" : " karma start --singleRun=false --autoWatch=true --autoWatchInterval=1 --browsers=Chrome" ,
2727 "docs" : " ./scripts/docs.js" ,
28+ "publishdocs" : " node scripts/publishdocs.js" ,
2829 "artifacts" : " node scripts/artifact_tagging.js"
2930 },
3031 "homepage" : " https://ui-router.github.io" ,
Original file line number Diff line number Diff line change 1+ #!env node
2+
3+ let package = require ( '../package.json' ) . name ;
4+ let version = require ( '../package.json' ) . version ;
5+
6+ let corePackage = require ( '../../core/package.json' ) . name ;
7+ let coreVersion = require ( '../../core/package.json' ) . version ;
8+
9+ let PAGES_DIR = "../ui-router.github.io" ;
10+ let sh = require ( 'shelljs' ) ;
11+ let readlineSync = require ( 'readline-sync' ) ;
12+ let fs = require ( 'fs' ) ;
13+ let path = require ( 'path' ) ;
14+ let util = require ( './util' ) ;
15+ let _exec = util . _exec ;
16+
17+
18+ sh . cd ( path . join ( __dirname , '..' ) ) ;
19+ if ( ! fs . existsSync ( PAGES_DIR ) ) {
20+ throw new Error ( "not found: " + PAGES_DIR ) ;
21+ }
22+
23+ if ( ! readlineSync . keyInYN ( `Generate/publish docs from your local copies of ${ package } @${ version } and ${ corePackage } @${ coreVersion } ?` ) ) {
24+ process . exit ( 1 ) ;
25+ }
26+
27+ _exec ( 'npm run docs' ) ;
28+
29+ sh . rm ( '-rf' , PAGES_DIR + '/_ng1_docs/latest' ) ;
30+ sh . cp ( '-r' , '_doc' , PAGES_DIR + '/_ng1_docs/latest' ) ;
31+ sh . cp ( '-r' , '_doc' , PAGES_DIR + '/_ng1_docs/' + version ) ;
32+ sh . cd ( PAGES_DIR + "/_ng1_docs/" ) ;
33+ _exec ( "./process_docs.sh" ) ;
34+ _exec ( "git add ." ) ;
35+
36+ sh . echo ( "\n\nSpot check the docs, then run these commands to publish:\n\n" ) ;
37+ sh . echo ( "cd " + PAGES_DIR ) ;
38+ sh . echo ( `git commit -m 'publish docs for ${ version } '` ) ;
39+ sh . echo ( `git push` ) ;
You can’t perform that action at this time.
0 commit comments