Skip to content

Commit

Permalink
Return -1 when push failed (google#175)
Browse files Browse the repository at this point in the history
Fixes google#174

- [x] `npm run test` succeeds.
- [x] `npm run lint` succeeds.
- [ ] Appropriate changes to README are included in PR.
  • Loading branch information
TETRA2000 authored and grant committed May 21, 2018
1 parent 24c7d13 commit 4f09743
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ commander
nonIgnoredFilePaths.map((filePath: string) => {
console.error(`└─ ${filePath}`);
});
process.exit(-1);
} else {
nonIgnoredFilePaths.map((filePath: string) => {
console.log(`└─ ${filePath}`);
Expand Down
10 changes: 10 additions & 0 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ describe.skip('Test clasp push function', () => {
expect(result.stdout).to.contain('files.');
expect(result.status).to.equal(0);
});
it('should return non-0 exit code when push failed', () => {
fs.writeFileSync('.claspignore', '**/**\n!Code.js\n!appsscript.json');
fs.writeFileSync('unexpected_file', '');
const result = spawnSync(
'clasp', ['push'], { encoding: 'utf8' },
);
expect(result.stdout).to.contain('failed.');
expect(result.stdout).to.contain('files.');
expect(result.status).to.equal(-1);
});
});

describe.skip('Test clasp status function', () => {
Expand Down

0 comments on commit 4f09743

Please sign in to comment.