From 999253f034885cbc360ecceac8092a90bb728abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Mon, 27 May 2019 13:58:43 +0200 Subject: [PATCH] Account for gitignores when running `git add` --- bin/after-version-bump.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/after-version-bump.js b/bin/after-version-bump.js index 32b22db20..90a838576 100755 --- a/bin/after-version-bump.js +++ b/bin/after-version-bump.js @@ -46,12 +46,13 @@ async function updateVersions (files, packageName) { async function gitAdd (files) { const git = spawn('git', ['add', ...files], { stdio: 'inherit' }) - const exitCode = await once(git, 'exit') + const [exitCode] = await once(git, 'exit') if (exitCode !== 0) { throw new Error(`git add failed with ${exitCode}`) } } +// Run the build as a release build (that inlines version numbers etc.) async function npmRunBuild () { const npmRun = spawn('npm', ['run', 'build'], { stdio: 'inherit', @@ -60,7 +61,7 @@ async function npmRunBuild () { IS_RELEASE_BUILD: true } }) - const exitCode = await once(npmRun, 'exit') + const [exitCode] = await once(npmRun, 'exit') if (exitCode !== 0) { throw new Error(`npm run build failed with ${exitCode}`) } @@ -93,7 +94,10 @@ async function main () { await updateVersions(files, '@uppy/robodog') await updateVersions(files, '@uppy/locales') - await gitAdd(files) + // gitignored files were updated for the npm package, but can't be updated + // on git. + const isIgnored = await globby.gitignore() + await gitAdd(files.filter((filename) => !isIgnored(filename))) await npmRunBuild() }