fix linting errors

This commit is contained in:
Vanessa Yuen 2017-11-02 16:20:41 +08:00
parent b23fa34470
commit bf5b9e70bb
2 changed files with 20 additions and 13 deletions

View file

@ -21,7 +21,6 @@ const ciJob = args._[0]
assert(ciJobs.includes(ciJob), `Unknown ci job name: ${ciJob}.`) assert(ciJobs.includes(ciJob), `Unknown ci job name: ${ciJob}.`)
assert(process.env.CIRCLE_TOKEN, 'CIRCLE_TOKEN not found in environment') assert(process.env.CIRCLE_TOKEN, 'CIRCLE_TOKEN not found in environment')
const circleBuildURL = `https://circleci.com/api/v1.1/project/github/electron/electron/tree/${targetBranch}?circle-token=${process.env.CIRCLE_TOKEN}` const circleBuildURL = `https://circleci.com/api/v1.1/project/github/electron/electron/tree/${targetBranch}?circle-token=${process.env.CIRCLE_TOKEN}`
console.log(`Triggering CircleCI to run build job: ${ciJob} against branch: ${targetBranch} with release flag.`) console.log(`Triggering CircleCI to run build job: ${ciJob} against branch: ${targetBranch} with release flag.`)
@ -40,7 +39,7 @@ request({
} }
}) })
}, (err, res, body) => { }, (err, res, body) => {
if (!err && res.statusCode == 200) { if (!err && body) {
const build = JSON.parse(body) const build = JSON.parse(body)
console.log(`check ${build.build_url} for status`) console.log(`check ${build.build_url} for status`)
} else { } else {

View file

@ -64,26 +64,34 @@ def main():
tag_exists) tag_exists)
# Upload Electron with GitHub Releases API. # Upload Electron with GitHub Releases API.
upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME),
upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME), args.upload_to_s3) args.upload_to_s3)
upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME),
args.upload_to_s3)
if PLATFORM == 'darwin': if PLATFORM == 'darwin':
upload_electron(github, release, os.path.join(DIST_DIR, args.upload_to_s3, upload_electron(github, release, os.path.join(DIST_DIR,
'electron-api.json')) 'electron-api.json'), args.upload_to_s3)
upload_electron(github, release, os.path.join(DIST_DIR, 'electron.d.ts'), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, 'electron.d.ts'),
upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME), args.upload_to_s3) args.upload_to_s3)
upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME),
args.upload_to_s3)
elif PLATFORM == 'win32': elif PLATFORM == 'win32':
upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME),
args.upload_to_s3)
# Upload free version of ffmpeg. # Upload free version of ffmpeg.
ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION) ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION)
upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg),
args.upload_to_s3)
# Upload chromedriver and mksnapshot for minor version update. # Upload chromedriver and mksnapshot for minor version update.
if parse_version(args.version)[2] == '0': if parse_version(args.version)[2] == '0':
chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION) chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION)
upload_electron(github, release, os.path.join(DIST_DIR, chromedriver), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, chromedriver),
args.upload_to_s3)
mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION) mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION)
upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot),
args.upload_to_s3)
# TODO: make s3 compatible # TODO: make s3 compatible
@ -222,7 +230,7 @@ def upload_electron(github, release, file_path, upload_to_s3):
arm_filename = filename.replace('armv7l', 'arm') arm_filename = filename.replace('armv7l', 'arm')
arm_file_path = os.path.join(os.path.dirname(file_path), arm_filename) arm_file_path = os.path.join(os.path.dirname(file_path), arm_filename)
shutil.copy2(file_path, arm_file_path) shutil.copy2(file_path, arm_file_path)
upload_electron(github, release, arm_file_path) upload_electron(github, release, arm_file_path, upload_to_s3)
def upload_io_to_github(release, filename, filepath): def upload_io_to_github(release, filename, filepath):