Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return an error when the promises are rejected (fixes #16) #17

Merged
merged 1 commit into from May 24, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Return an error when the promises are rejected (fixes #16)

  • Loading branch information
fmarier committed May 22, 2019
commit 7744d535b573ee43d1c576549f14b2785794630d
@@ -1,6 +1,7 @@
const fs = require('fs')
const s3 = require('s3-client')
const commander = require('commander')
const process = require('process')

const splitVersion = process.env.npm_package_version.split('.')
splitVersion.splice(2)
@@ -51,9 +52,15 @@ const date = new Date().toISOString().split('.')[0]
const dataFilenames = fs.readdirSync('out')
dataFilenames.forEach((filename) => {
if (commander.prod) {
p = p.then(uploadFile.bind(null, dataFileVersion, `out/${filename}`, filename))
p = p.then(uploadFile.bind(null, `backups/${date}`, `out/${filename}`, filename))
p = p.then(uploadFile.bind(null, dataFileVersion, `out/${filename}`, filename)).catch(() => {
process.exit(1)
})
p = p.then(uploadFile.bind(null, `backups/${date}`, `out/${filename}`, filename)).catch(() => {
process.exit(1)
})
} else {
p = p.then(uploadFile.bind(null, `test/${dataFileVersion}`, `out/${filename}`, filename))
p = p.then(uploadFile.bind(null, `test/${dataFileVersion}`, `out/${filename}`, filename)).catch(() => {
process.exit(1)
})
}
})
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.