@@ -10,38 +10,9 @@ const exec = (command, extraEnv) =>
1010 env : Object . assign ( { } , process . env , extraEnv )
1111 } ) ;
1212
13- const execOut = ( command , extraEnv ) =>
14- execSync ( command , {
15- stdio : "pipe" ,
16- env : Object . assign ( { } , process . env , extraEnv )
17- } ) . toString ( 'utf8' ) . trim ( ) ;
18-
19- const branch = execOut ( 'git rev-parse --symbolic-full-name --abbrev-ref HEAD' ) ;
20-
21- if ( branch !== 'master' ) {
22- console . log ( 'You must be on branch "master" to run: npm run publish' ) ;
23- process . exit ( 1 ) ;
24- }
25-
26- const bump = process . argv [ 3 ] ;
27-
28- if ( ! bump || ! [ 'major' , 'minor' , 'patch' ] . includes ( bump ) ) {
29- console . log ( `Please pass (major|minor|patch) as an argument.` ) ;
30- console . log ( `example: npm run publish minor` ) ;
31- process . exit ( 1 ) ;
32- }
33-
34- console . log ( 'Making sure we have the latest master changes.' ) ;
35- exec ( 'git pull' ) ;
36-
37- console . log ( `Creating new ${ bump } version of react-governor.` ) ;
13+ console . log ( `Building react-governor.` ) ;
3814exec ( 'npm run build' ) ;
3915
40- // This will fail and exit if the git working directory is not clean
41- // This updates and commits the package.json
42- console . log ( 'Updating package.json' ) ;
43- exec ( `npm version ${ bump } ` ) ;
44-
4516const packageJSON = require ( "../package.json" ) ;
4617console . log ( 'Pushing to npm repository' ) ;
4718exec ( 'npm publish --access public' ) ;
0 commit comments