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

Remove dependency that can be replaced with a one-liner #34

Merged
merged 1 commit into from Mar 19, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Remove dependency that can be replaced with a one-liner

  • Loading branch information
fmarier committed Mar 19, 2020
commit 5f7122909f732237d2923b3408834e774690dd58

Some generated files are not rendered by default. Learn more.

@@ -3,7 +3,6 @@
"version": "6.0.0",
"description": "https everywhere ruleset builder for Brave",
"dependencies": {
"commander": "^2.11.0",
"level": "^5.0.1",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
@@ -1,6 +1,5 @@
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('.')
@@ -41,17 +40,13 @@ const uploadFile = (key, filePath, filename) => {
})
}

commander
.option('-p, --prod', 'whether the upload is for prod, if not specified uploads to the test location')
.parse(process.argv)

// Queue up all the uploads one at a time to easily spot errors
let p = Promise.resolve()
const date = new Date().toISOString().split('.')[0]

const dataFilenames = fs.readdirSync('out')
dataFilenames.forEach((filename) => {
if (commander.prod) {
if (process.argv.slice(2).indexOf("--prod") > -1 || process.argv.slice(2).indexOf("-p") > -1) {
p = p.then(uploadFile.bind(null, 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.