Skip to content

Commit

Permalink
Better error handling for js global commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel2392 committed May 9, 2024
1 parent 0fb0d2c commit f139819
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ function main() {
console.info(`Committing changes with default message: 'QuickGo update'`);
errD = os.exec(`git commit -m "QuickGo update"`);
}
if (errD) {
if (errD.error) {
return Result(1, `Could not commit changes to git! ${errD.stdout}`);
}

if (quickgo.environ.tag) {
console.info(`Tagging commit with tag ${quickgo.environ.tag}`);
errD = os.exec(`git tag ${quickgo.environ.tag}`);
}
if (errD) {
if (errD.error) {
return Result(1, `Could not tag commit with tag ${quickgo.environ.tag}! ${errD.stdout}`);
}

Expand All @@ -52,7 +52,7 @@ function main() {

console.info(`Executing git command: ${pushStr}`)
errD = os.exec(pushStr);
if (errD) {
if (errD.error) {
return Result(1, `Could not push changes to remote repository! ${errD.stdout}`);
}

Expand Down

0 comments on commit f139819

Please sign in to comment.