File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ after_success:
2424- mkdir s3-publish
2525- cp nativescript*.tgz s3-publish/nativescript.tgz
2626before_deploy :
27- - node .travis/add-publishConfig.js
27+ - node .travis/add-publishConfig.js $TRAVIS_BRANCH
2828deploy :
2929 - provider : s3
3030 bucket : nativescript-ci
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- var fsModule = require ( 'fs' ) ;
3+ var fsModule = require ( "fs" ) ;
44
55// Adds a publishConfig section to the package.json file
66// and sets a tag to it
77
8- var path = ' ./package.json' ;
8+ var path = " ./package.json" ;
99var fileOptions = { encoding : "utf-8" } ;
1010var content = fsModule . readFileSync ( path , fileOptions ) ;
1111
@@ -14,11 +14,12 @@ if (!packageDef.publishConfig) {
1414 packageDef . publishConfig = { } ;
1515}
1616
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 ) ;
2121}
22+ packageDef . publishConfig . tag = branch === "release" ? "rc" : "next" ;
2223
23- var newContent = JSON . stringify ( packageDef , null , ' ' ) ;
24+ var newContent = JSON . stringify ( packageDef , null , " " ) ;
2425fsModule . writeFileSync ( path , newContent , fileOptions ) ;
You can’t perform that action at this time.
0 commit comments