Skip to content

Commit a82cfec

Browse files
author
Vasil Chimev
authored
Update Travis CI Scripts (#2804)
1 parent 970f548 commit a82cfec

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ after_success:
2424
- mkdir s3-publish
2525
- cp nativescript*.tgz s3-publish/nativescript.tgz
2626
before_deploy:
27-
- node .travis/add-publishConfig.js
27+
- node .travis/add-publishConfig.js $TRAVIS_BRANCH
2828
deploy:
2929
- provider: s3
3030
bucket: nativescript-ci

.travis/add-publishConfig.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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";
99
var fileOptions = {encoding: "utf-8"};
1010
var 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, " ");
2425
fsModule.writeFileSync(path, newContent, fileOptions);

0 commit comments

Comments
 (0)