Skip to content

Commit 770a0df

Browse files
hanslfilipesilva
authored andcommitted
build: fix deploy script condition (take 12)
1 parent 15cae8a commit 770a0df

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

scripts/git-builds.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ function main() {
9393
const tempRoot = temp.mkdirSync('angular-cli-builds');
9494
const tempExec = new Executor(tempRoot);
9595

96+
const branchName = process.env['TRAVIS_BRANCH'];
97+
9698
console.log(green('Cloning builds repos...\n'));
9799
tempExec.git('clone', cliBuilds);
98100
tempExec.git('clone', ngToolsWebpackBuilds);
@@ -110,7 +112,7 @@ function main() {
110112
const hash = message.split(' ')[0];
111113

112114
console.log(green('Copying ng-tools-webpack-builds dist'));
113-
ngToolsWebpackBuildsExec.git('checkout', '-B', process.env['TRAVIS_BRANCH']);
115+
ngToolsWebpackBuildsExec.git('checkout', '-B', branchName);
114116
ngToolsWebpackBuildsExec.rm('-rf', ...ngToolsWebpackBuildsExec.glob('*'));
115117
cliExec.cp('dist/@ngtools/webpack', ngToolsWebpackBuildsRoot);
116118
console.log(green('Updating package.json version'));
@@ -125,7 +127,7 @@ function main() {
125127

126128

127129
console.log(green('Copying cli-builds dist'));
128-
cliBuildsExec.git('checkout', '-B', process.env['TRAVIS_BRANCH']);
130+
cliBuildsExec.git('checkout', '-B', branchName);
129131
cliBuildsExec.rm('-rf', ...cliBuildsExec.glob('*'));
130132
cliExec.cp('dist/@angular/cli', cliBuildsRoot);
131133

@@ -142,10 +144,10 @@ function main() {
142144
`https://${process.env['GITHUB_ACCESS_TOKEN']}@github.com`);
143145

144146
console.log(green('Done. Pushing...'));
145-
ngToolsWebpackBuildsExec.git('push', '-f');
146-
ngToolsWebpackBuildsExec.git('push', '--tags');
147-
cliBuildsExec.git('push', '-f');
148-
cliBuildsExec.git('push', '--tags');
147+
ngToolsWebpackBuildsExec.git('push', '-f', branchName);
148+
ngToolsWebpackBuildsExec.git('push', '--tags', branchName);
149+
cliBuildsExec.git('push', '-f', branchName);
150+
cliBuildsExec.git('push', '--tags', branchName);
149151
}
150152

151153
main();

0 commit comments

Comments
 (0)