@@ -10,38 +10,9 @@ const exec = (command, extraEnv) =>
10
10
env : Object . assign ( { } , process . env , extraEnv )
11
11
} ) ;
12
12
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.` ) ;
38
14
exec ( 'npm run build' ) ;
39
15
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
-
45
16
const packageJSON = require ( "../package.json" ) ;
46
17
console . log ( 'Pushing to npm repository' ) ;
47
18
exec ( 'npm publish --access public' ) ;
0 commit comments