File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!env node
2
2
"use strict" ;
3
3
4
+ let version = require ( '../package.json' ) . version ;
5
+
4
6
require ( 'shelljs/global' ) ;
5
7
let readlineSync = require ( 'readline-sync' ) ;
8
+ let fs = require ( 'fs' ) ;
9
+ let path = require ( 'path' ) ;
6
10
let util = require ( './util' ) ;
7
11
let _exec = util . _exec ;
8
12
9
- let version = require ( '../package.json' ) . version ;
13
+ cd ( path . join ( __dirname , '..' ) ) ;
10
14
11
15
if ( ! readlineSync . keyInYN ( 'Did you bump the version number in package.json?' ) ) {
12
16
process . exit ( 1 ) ;
@@ -16,12 +20,24 @@ if (!readlineSync.keyInYN('Did you update CHANGELOG.md using scripts/update_chan
16
20
process . exit ( 1 ) ;
17
21
}
18
22
19
- if ( ! readlineSync . keyInYN ( 'Did you commit/push all changes back to origin?' ) ) {
23
+ if ( ! readlineSync . keyInYN ( 'Did you push all changes back to origin?' ) ) {
24
+ process . exit ( 1 ) ;
25
+ }
26
+
27
+ if ( ! readlineSync . keyInYN ( 'Ready to publish?' ) ) {
20
28
process . exit ( 1 ) ;
21
29
}
22
30
23
31
util . ensureCleanMaster ( 'master' ) ;
32
+
33
+ _exec ( 'npm run package' ) ;
34
+ _exec ( `npm run docs` ) ;
35
+
36
+ // publish to npm first
24
37
_exec ( `npm publish` ) ;
38
+
39
+ // then tag and push tag
25
40
_exec ( `git tag ${ version } ` ) ;
26
41
_exec ( `git push origin ${ version } ` ) ;
27
42
43
+ console . log ( "\n\nAPI docs generated (but not deployed) at ./_docs" ) ;
You can’t perform that action at this time.
0 commit comments