aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-02 20:20:42 +0800
committerFabio Berger <me@fabioberger.com>2018-07-02 20:20:42 +0800
commite553ef83de473fd493f32158bc61e39778acc623 (patch)
treec2dfa95576821958d731aca7a49803870c15c852 /packages/monorepo-scripts
parenta619949a56937d29b3e7463812e9ea8515d21126 (diff)
downloaddexon-0x-contracts-e553ef83de473fd493f32158bc61e39778acc623.tar.gz
dexon-0x-contracts-e553ef83de473fd493f32158bc61e39778acc623.tar.zst
dexon-0x-contracts-e553ef83de473fd493f32158bc61e39778acc623.zip
Git command outputs logs to stdErr so only way to check for errors if with try/catch
Diffstat (limited to 'packages/monorepo-scripts')
-rw-r--r--packages/monorepo-scripts/src/utils/utils.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts
index 7019f9241..4d3e2d709 100644
--- a/packages/monorepo-scripts/src/utils/utils.ts
+++ b/packages/monorepo-scripts/src/utils/utils.ts
@@ -103,20 +103,22 @@ export const utils = {
return tagVersionByPackageName;
},
async removeLocalTagAsync(tagName: string): Promise<void> {
- const result = await execAsync(`git tag -d ${tagName}`, {
+ try {
+ await execAsync(`git tag -d ${tagName}`, {
cwd: constants.monorepoRootPath,
});
- if (!_.isEmpty(result.stderr)) {
- throw new Error(`Failed to delete local git tag. Got err: ${result.stderr}`);
+ } catch (err) {
+ throw new Error(`Failed to delete local git tag. Got err: ${err}`);
}
this.log(`Removed local tag: ${tagName}`);
},
async removeRemoteTagAsync(tagName: string): Promise<void> {
- const result = await execAsync(`git push origin ${tagName}`, {
+ try {
+ await execAsync(`git push origin ${tagName}`, {
cwd: constants.monorepoRootPath,
});
- if (!_.isEmpty(result.stderr)) {
- throw new Error(`Failed to delete remote git tag. Got err: ${result.stderr}`);
+ } catch (err) {
+ throw new Error(`Failed to delete remote git tag. Got err: ${err}`);
}
this.log(`Removed remote tag: ${tagName}`);
},