Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
info.candidates.forEach(function (candidatePath) {
if (!fileExists(candidatePath)) {
// maybe the folder has been moved or deleted
return
}
const pkg = loadFile(candidatePath)
if (!is.object(pkg)) {
console.error('could not read %s', candidatePath)
return
}
if (!is.semver(pkg.version)) {
console.error('could not read semver from %s got', candidatePath, pkg.version)
return
}
addCandidateInfo(info, candidatePath, pkg.version)
})
return info
'--commit': String,
'--version': String,
// optional, if passed, only the binary for that platform will be moved
'--platformArch': String,
// aliases
'--sha': '--commit',
'-v': '--version'
}, {
argv: args.slice(2)
})
debug('moveBinaries with options %o', options)
// @ts-ignore
la(is.commitId(options['--commit']), 'missing or invalid commit SHA', options)
// @ts-ignore
la(is.semver(options['--version']), 'missing version to collect', options)
const releaseOptions: ReleaseInformation = {
commit: options['--commit'],
version: options['--version']
}
const aws = uploadUtils.getS3Credentials()
const s3 = s3helpers.makeS3(aws)
// found s3 paths with last build for same commit for all platforms
const lastBuilds: Desktop[] = []
let platforms: platformArch[] = uploadUtils.getValidPlatformArchs()
if (options['--platformArch']) {
const onlyPlatform = options['--platformArch']
console.log('only moving single platform %s', onlyPlatform)
it('does not like tags', function () {
la(is.semver('0.0.1'), 'plain semver')
la(!is.semver('0.0.1-beta'), 'semver with tag')
la(!is.semver('5.0.0-alpha.13'), 'semver with alpha and number')
})
it('does not like tags', function () {
la(is.semver('0.0.1'), 'plain semver')
la(!is.semver('0.0.1-beta'), 'semver with tag')
la(!is.semver('5.0.0-alpha.13'), 'semver with alpha and number')
})
function isLaterVersion (a, b) {
la(is.semver(a), 'not semver', a)
la(is.semver(b), 'not semver', b)
return semver.gt(a, b)
}
function setVersion (newVersion) {
if (!args.go) {
debug('skipping "npm version" command, because no --go option set')
return
}
if (!newVersion) {
debug('skipping "npm version" command, no new version')
return
}
debug(`running "npm version %s" command`, newVersion)
la(is.semver(newVersion), 'invalid new version', newVersion)
return npmUtils.incrementVersion({
increment: newVersion
})
}
function isLaterVersion (a, b) {
la(is.semver(a), 'not semver', a)
la(is.semver(b), 'not semver', b)
return semver.gt(a, b)
}
function checkProps (release) {
la(is.semver(release.version), 'missing version', release)
la(is.maybe.unemptyString(release.age), 'missing age', release)
la(is.maybe.unemptyString(release['dist-tag']), 'wrong dist tag', release)
}