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

chore: make nugget quiet by default #16147

Merged
merged 2 commits into from Dec 20, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 9 additions & 13 deletions script/release.js
Expand Up @@ -307,7 +307,7 @@ async function verifyAssets (release) {
let filesToCheck = await Promise.all(release.assets.map(async (asset) => {
githubOpts.id = asset.id
const assetDetails = await github.repos.getAsset(githubOpts)
await downloadFiles(assetDetails.meta.location, downloadDir, false, asset.name)
await downloadFiles(assetDetails.meta.location, downloadDir, asset.name)
return asset.name
})).catch(err => {
console.log(`${fail} Error downloading files from GitHub`, err)
Expand All @@ -325,21 +325,17 @@ async function verifyAssets (release) {
})
}

function downloadFiles (urls, directory, quiet, targetName) {
function downloadFiles (urls, directory, targetName) {
return new Promise((resolve, reject) => {
const nuggetOpts = {
dir: directory
}
if (quiet) {
nuggetOpts.quiet = quiet
}
if (targetName) {
nuggetOpts.target = targetName
}
const nuggetOpts = { dir: directory }
nuggetOpts.quiet = true
if (targetName) nuggetOpts.target = targetName

nugget(urls, nuggetOpts, (err) => {
if (err) {
reject(err)
} else {
console.log(`${pass} all files downloaded successfully!`)
resolve()
}
})
Expand Down Expand Up @@ -369,7 +365,7 @@ async function verifyShasums (urls, isS3) {
if (s3VersionPathIdx !== -1 && filename.indexof('SHASUMS') === -1) {
filesToCheck.push(filename)
}
await downloadFiles(url, downloadDir, true)
await downloadFiles(url, downloadDir)
} else {
const subDirectory = dirname.substr(s3VersionPathIdx + s3VersionPath.length)
const fileDirectory = path.join(downloadDir, subDirectory)
Expand All @@ -379,7 +375,7 @@ async function verifyShasums (urls, isS3) {
fs.mkdirSync(fileDirectory)
}
filesToCheck.push(path.join(subDirectory, filename))
await downloadFiles(url, fileDirectory, true)
await downloadFiles(url, fileDirectory)
}
}))
}
Expand Down