mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-22 09:48:06 +00:00
Account for gitignores when running git add
This commit is contained in:
parent
bc6da2a637
commit
999253f034
1 changed files with 7 additions and 3 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue