Skip to content

Commit aa761d4

Browse files
committed
Handled failed clasp push bettter and include now-required message with invocation of clasp version
1 parent e8656e7 commit aa761d4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ module.exports = {
4545
var claspProjectDir = path.dirname(configFile);
4646
process.chdir(claspProjectDir);
4747
this.log(`Running \`clasp push\` and \`clasp version\` in ${claspProjectDir}`);
48-
var claspPromise = execFile('clasp', ['push']).then(({ stdout }/*, stderr*/) => {
48+
var claspPromise = execFile('clasp', ['push', '-f']).then(({ stdout , stderr }) => {
4949
this.log(stdout);
50-
}).then(() => execFile('clasp', ['version']).then(({ stdout }/*, stderr*/) => {
50+
this.log(stderr);
51+
if (stderr && stderr.includes('Push failed')) {
52+
throw new Error(stderr);
53+
}
54+
}).then(() => execFile('clasp', ['version', '"Pushed by ember-cli-deploy-clasp"']).then(({ stdout , stderr }) => {
5155
this.log(stdout);
56+
this.log(stderr);
5257
})).then(() => {
5358
if (fs.existsSync('.upload-message')) {
5459
var uploadMessage = fs.readFileSync('.upload-message', 'utf8');

0 commit comments

Comments
 (0)