File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ after_success:
24
24
- mkdir s3-publish
25
25
- cp nativescript*.tgz s3-publish/nativescript.tgz
26
26
before_deploy :
27
- - node .travis/add-publishConfig.js
27
+ - node .travis/add-publishConfig.js $TRAVIS_BRANCH
28
28
deploy :
29
29
- provider : s3
30
30
bucket : nativescript-ci
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
3
- var fsModule = require ( 'fs' ) ;
3
+ var fsModule = require ( "fs" ) ;
4
4
5
5
// Adds a publishConfig section to the package.json file
6
6
// and sets a tag to it
7
7
8
- var path = ' ./package.json' ;
8
+ var path = " ./package.json" ;
9
9
var fileOptions = { encoding : "utf-8" } ;
10
10
var content = fsModule . readFileSync ( path , fileOptions ) ;
11
11
@@ -14,11 +14,12 @@ if (!packageDef.publishConfig) {
14
14
packageDef . publishConfig = { } ;
15
15
}
16
16
17
- if ( $TRAVIS_BRANCH === 'release' ) {
18
- packageDef . publishConfig . tag = 'rc' ;
19
- } else {
20
- packageDef . publishConfig . tag = 'next' ;
17
+ var branch = process . argv [ 2 ] ;
18
+ if ( ! branch ) {
19
+ console . log ( "Please pass the branch name as an argument!" ) ;
20
+ process . exit ( 1 ) ;
21
21
}
22
+ packageDef . publishConfig . tag = branch === "release" ? "rc" : "next" ;
22
23
23
- var newContent = JSON . stringify ( packageDef , null , ' ' ) ;
24
+ var newContent = JSON . stringify ( packageDef , null , " " ) ;
24
25
fsModule . writeFileSync ( path , newContent , fileOptions ) ;
You can’t perform that action at this time.
0 commit comments