Skip to content

Commit ba89bca

Browse files
committed
Update release script
1 parent f225533 commit ba89bca

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

support/release.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ var buildDir = path.join(rootDir, '_build');
8888
var branch = args[0] || 'master';
8989
var pushBranches = [ branch ];
9090
var npmTag = 'latest';
91+
var exitCode = 0;
9192

9293
// the version to be released
9394
var version;
@@ -238,6 +239,7 @@ run('git config receive.denyCurrentBranch').then(
238239
});
239240
}).then(function () {
240241
// Publish the package
242+
process.chdir('dist');
241243
return run('npm publish --tag ' + npmTag);
242244
}).then(function () {
243245
// Update the original repo with the new branch and tag pointers
@@ -247,18 +249,15 @@ run('git config receive.denyCurrentBranch').then(
247249
return run('git push origin --tags');
248250
});
249251
}).then(function () {
250-
rl.close();
251252
cleanup();
252253
print('\nAll done! Yay!\n');
253254
}).catch(function (error) {
254-
rl.close();
255-
if (error.message === 'Aborted') {
256-
cleanup();
257-
}
258-
else {
255+
if (error.message !== 'Aborted') {
259256
// Something broke -- display an error
260257
print(error + '\n');
261258
print('Aborted.\n');
262-
process.exit(1);
259+
exitCode = 1;
263260
}
261+
}).then(function () {
262+
process.exit(exitCode);
264263
});

0 commit comments

Comments
 (0)