@bobfrankston/npmglobalize 1.0.132 → 1.0.133

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.
Files changed (2) hide show
  1. package/lib.js +27 -0
  2. package/package.json +1 -1
package/lib.js CHANGED
@@ -3636,6 +3636,33 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
3636
3636
  }
3637
3637
  }
3638
3638
  }
3639
+ else if (error.message?.includes('not clean') || error.message?.includes('working directory')) {
3640
+ // Working directory not clean — commit stray changes and retry
3641
+ console.log(colors.yellow('\nWorking directory not clean — committing stray changes and retrying...'));
3642
+ const addRes = runCommand('git', ['add', '-A'], { cwd, silent: true });
3643
+ if (addRes.success) {
3644
+ const commitRes = gitCommit('Pre-version cleanup', cwd);
3645
+ if (commitRes.success) {
3646
+ try {
3647
+ const newVersion = await libversion(bump, {
3648
+ path: cwd,
3649
+ 'git-tag-version': true
3650
+ });
3651
+ console.log(colors.green(`Version bumped to ${newVersion}`));
3652
+ autoFixed = true;
3653
+ }
3654
+ catch (retryError) {
3655
+ console.error(colors.red('Retry failed:'), retryError.message);
3656
+ if (!force) {
3657
+ return false;
3658
+ }
3659
+ }
3660
+ }
3661
+ }
3662
+ if (!autoFixed && !force) {
3663
+ return false;
3664
+ }
3665
+ }
3639
3666
  else if (error.message?.includes('unknown git error')) {
3640
3667
  console.error(colors.yellow('\nPossible causes:'));
3641
3668
  console.error(' • Git hooks (pre-commit, commit-msg) might be failing');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.132",
3
+ "version": "1.0.133",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",