@socketsecurity/cli-with-sentry 0.15.28 → 0.15.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -3670,13 +3670,13 @@ async function gitCreateAndPushBranch(branch, commitMsg, filepaths, options) {
3670
3670
  await spawn.spawn('git', ['push', '--force', '--set-upstream', 'origin', branch], stdioIgnoreOptions);
3671
3671
  return true;
3672
3672
  } catch (e) {
3673
+ debug.debugLog('gitCreateAndPushBranch: Unexpected error.');
3673
3674
  debug.debugLog(e);
3674
3675
  }
3675
3676
  try {
3677
+ // Will throw with exit code 1 if branch does not exist.
3676
3678
  await spawn.spawn('git', ['branch', '-D', branch], stdioIgnoreOptions);
3677
- } catch (e) {
3678
- debug.debugLog(e);
3679
- }
3679
+ } catch {}
3680
3680
  return false;
3681
3681
  }
3682
3682
  async function gitEnsureIdentity(name, email, cwd = process.cwd()) {
@@ -3692,14 +3692,18 @@ async function gitEnsureIdentity(name, email, cwd = process.cwd()) {
3692
3692
  0: prop,
3693
3693
  1: value
3694
3694
  }) => {
3695
+ let configValue;
3695
3696
  try {
3696
- const output = await spawn.spawn('git', ['config', '--get', prop], stdioPipeOptions);
3697
- debug.debugLog(`git config --get ${prop}`, output.stdout.trim());
3698
- if (output.stdout.trim() !== value) {
3697
+ // Will throw with exit code 1 if the config property is not set.
3698
+ configValue = (await spawn.spawn('git', ['config', '--get', prop], stdioPipeOptions)).stdout.trim();
3699
+ } catch {}
3700
+ if (configValue !== value) {
3701
+ try {
3699
3702
  await spawn.spawn('git', ['config', prop, value], stdioIgnoreOptions);
3703
+ } catch (e) {
3704
+ debug.debugLog('gitEnsureIdentity: Unexpected error.');
3705
+ debug.debugLog(e);
3700
3706
  }
3701
- } catch (e) {
3702
- debug.debugLog(e);
3703
3707
  }
3704
3708
  }));
3705
3709
  }
@@ -12709,5 +12713,5 @@ void (async () => {
12709
12713
  await utils.captureException(e);
12710
12714
  }
12711
12715
  })();
12712
- //# debugId=4152a7bd-9a30-4cd4-85e5-3dff2f0b8d70
12716
+ //# debugId=ce4e0e8e-e2f8-4e46-9702-3404ee5c7720
12713
12717
  //# sourceMappingURL=cli.js.map