diff --git a/lib/bump.js b/lib/bump.js index fb4660a..f51d9ae 100644 --- a/lib/bump.js +++ b/lib/bump.js @@ -109,7 +109,16 @@ module.exports = async (type, preSuffix) => { createSpinner('Creating release commit'); try { - await runGitCommand(`git add -A && git commit -a -m "${version}"`); + const commitFiles = ['package.json']; + + const lockfilePath = path.join(process.cwd(), 'package-lock.json'); + if (fs.existsSync(lockfilePath)) { + commitFiles.append('package-lock.json'); + } + + await runGitCommand( + `git add ${commitFiles.join(' ')} && git commit -m "${version}"` + ); } catch (err) { fail(err.message); }