💄 Add assetName variable

This commit is contained in:
Kevin Sawicki 2013-12-10 17:49:53 -08:00
parent 1851c81e60
commit 897bf2f8e0

View File

@ -10,7 +10,8 @@ fs = require 'fs-plus'
GitHub = require 'github-releases'
request = require 'request'
assetPath = '/tmp/atom-build/atom-mac.zip'
assetName = 'atom-mac-zip'
assetPath = "/tmp/atom-build/#{assetName}"
commitSha = process.env.JANKY_SHA1
token = process.env.ATOM_ACCESS_TOKEN
defaultHeaders =
@ -21,7 +22,7 @@ zipApp = (callback) ->
fs.removeSync(assetPath)
options = {cwd: path.dirname(assetPath), maxBuffer: Infinity}
child_process.exec "zip -r --symlinks #{path.basename(assetPath)} Atom.app", options, (error, stdout, stderr) ->
child_process.exec "zip -r --symlinks #{assetName} Atom.app", options, (error, stdout, stderr) ->
if error?
console.error('Zipping Atom.app failed', error, stderr)
process.exit(1)
@ -45,7 +46,7 @@ getRelease = (callback) ->
callback()
deleteExistingAsset = (release, callback) ->
for asset in release.assets when asset.name is path.basename(assetPath)
for asset in release.assets when asset.name is assetName
options =
uri: asset.url
method: 'DELETE'
@ -87,7 +88,7 @@ createRelease = (callback) ->
uploadAsset = (release, callback) ->
options =
uri: "https://uploads.github.com/repos/atom/atom-master-builds/releases/#{release.id}/assets?name=#{path.basename(assetPath)}"
uri: "https://uploads.github.com/repos/atom/atom-master-builds/releases/#{release.id}/assets?name=#{assetName}"
method: 'POST'
headers: _.extend({
'Content-Type': 'application/zip'