@socketsecurity/cli-with-sentry 0.15.27 → 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
@@ -3669,8 +3669,12 @@ async function gitCreateAndPushBranch(branch, commitMsg, filepaths, options) {
3669
3669
  await spawn.spawn('git', ['commit', '-m', commitMsg], stdioIgnoreOptions);
3670
3670
  await spawn.spawn('git', ['push', '--force', '--set-upstream', 'origin', branch], stdioIgnoreOptions);
3671
3671
  return true;
3672
- } catch {}
3672
+ } catch (e) {
3673
+ debug.debugLog('gitCreateAndPushBranch: Unexpected error.');
3674
+ debug.debugLog(e);
3675
+ }
3673
3676
  try {
3677
+ // Will throw with exit code 1 if branch does not exist.
3674
3678
  await spawn.spawn('git', ['branch', '-D', branch], stdioIgnoreOptions);
3675
3679
  } catch {}
3676
3680
  return false;
@@ -3684,18 +3688,23 @@ async function gitEnsureIdentity(name, email, cwd = process.cwd()) {
3684
3688
  cwd
3685
3689
  };
3686
3690
  const identEntries = [['user.email', name], ['user.name', email]];
3687
- debug.debugLog('identEntries', identEntries);
3688
3691
  await Promise.all(identEntries.map(async ({
3689
3692
  0: prop,
3690
3693
  1: value
3691
3694
  }) => {
3695
+ let configValue;
3692
3696
  try {
3693
- const output = await spawn.spawn('git', ['config', '--get', prop], stdioPipeOptions);
3694
- debug.debugLog(`git config --get ${prop}`, output.stdout.trim());
3695
- 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 {
3696
3702
  await spawn.spawn('git', ['config', prop, value], stdioIgnoreOptions);
3703
+ } catch (e) {
3704
+ debug.debugLog('gitEnsureIdentity: Unexpected error.');
3705
+ debug.debugLog(e);
3697
3706
  }
3698
- } catch {}
3707
+ }
3699
3708
  }));
3700
3709
  }
3701
3710
  async function gitRemoteBranchExists(branch, cwd = process.cwd()) {
@@ -12704,5 +12713,5 @@ void (async () => {
12704
12713
  await utils.captureException(e);
12705
12714
  }
12706
12715
  })();
12707
- //# debugId=6146693d-aec6-4897-9f06-173f731fa9c8
12716
+ //# debugId=ce4e0e8e-e2f8-4e46-9702-3404ee5c7720
12708
12717
  //# sourceMappingURL=cli.js.map