bbump 1.0.1 → 1.0.2

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/index.js +7 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -36,10 +36,15 @@ try {
36
36
 
37
37
  // Add only package.json and lockfile to Git
38
38
  const lockfile = isYarn ? 'yarn.lock' : 'package-lock.json';
39
- execSync(`git add package.json ${lockfile}`, { stdio: 'inherit' });
39
+ const filesToAdd = ['package.json'];
40
+ if (existsSync(lockfile)) {
41
+ filesToAdd.push(lockfile);
42
+ }
43
+
44
+ execSync(`git add ${filesToAdd.join(' ')}`, { stdio: 'inherit' });
40
45
 
41
46
  // Commit only the specified files with a fixed commit message
42
- execSync(`git commit -m "chore: bump version" package.json ${lockfile}`, { stdio: 'inherit' });
47
+ execSync(`git commit -m "chore: bump version" ${filesToAdd.join(' ')}`, { stdio: 'inherit' });
43
48
 
44
49
  console.log(`Version bumped to ${versionType} and changes committed with message: 'chore: bump version'.`);
45
50
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bbump",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Bump version based on branch prefix",
5
5
  "main": "index.js",
6
6
  "type": "module",