Git clone consumes the error, causing the subsequent steps to still run when they shouldn't. Need to either rethrow or replace chained execution with await.
|
}catch(error: any){ |
|
if(error){ |
|
logger.error(`Push failed: ${auth.mask(String(error), cred)}`, true); |
|
cleanup(temp); |
|
} |
|
} |
|
} |
|
}) |
|
// add files |
|
.add(".", gitback) |
|
// commit changes |
|
.commit(`${version} ${config.get("includeHostnameInCommitMessage") ? `<${os.userInfo().username}@${os.hostname()}> ` : ""} Update settings repository`, gitback) |
|
// push to remote |
|
.push(["-u", "origin", "HEAD"], (err: GitError | null) => { |
|
gitback(err); |
|
if(!err){ |
|
logger.info(`Pushed settings to ${repo}@${branch}`, true); |
|
cleanup(temp); |
|
} |
|
}); |
|
}catch(error: any){ |
|
logger.error(`Push failed: ${auth.mask(String(error?.message ?? error), cred)}`, true); |
|
}finally{ |
|
cleanup(temp); |
|
} |
Git clone consumes the error, causing the subsequent steps to still run when they shouldn't. Need to either rethrow or replace chained execution with await.
Settings-Repository/src/sync/git.ts
Lines 257 to 281 in d4b0598