use standard js style

This commit is contained in:
Max Ogden 2015-03-04 13:08:16 -08:00
parent 2a048369fe
commit 1809db5669
3 changed files with 15 additions and 11 deletions

View file

@ -1 +1,5 @@
versions published to npm should match the versions published to [github releases for atom-shell](https://github.com/atom/atom-shell/releases) versions published to npm should match the versions published to [github releases for atom-shell](https://github.com/atom/atom-shell/releases)
coding style should be `standard`:
[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard)

View file

@ -8,15 +8,15 @@ var fs = require('fs')
var platform = os.platform() var platform = os.platform()
var arch = os.arch() var arch = os.arch()
if ('win32' === platform) { if (platform === 'win32') {
// 64-bit is not available under windows. // 64-bit is not available under windows.
arch = 'ia32'; arch = 'ia32'
} }
var version = '0.21.3' var version = '0.21.3'
var name = 'atom-shell-v'+version+'-'+platform+'-'+arch+'.zip' var filename = 'atom-shell-v' + version + '-' + platform + '-' + arch + '.zip'
var url = 'https://github.com/atom/atom-shell/releases/download/v'+version+'/atom-shell-v'+version+'-'+platform+'-'+arch+'.zip' var url = 'https://github.com/atom/atom-shell/releases/download/v' + version + '/atom-shell-v' + version + '-' + platform + '-' + arch + '.zip'
var onerror = function(err) { function onerror (err) {
throw err throw err
} }
@ -38,13 +38,13 @@ var argv = {
win32: '%*' // does this work with " " in the args? win32: '%*' // does this work with " " in the args?
} }
if (!paths[platform]) throw new Error('Unknown platform: '+platform) if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
nugget(url, {target:name, dir:__dirname, resume:true, verbose:true}, function(err) { nugget(url, {target: filename, dir: __dirname, resume: true, verbose: true}, function (err) {
if (err) return onerror(err) if (err) return onerror(err)
fs.writeFileSync(path.join(__dirname, 'path.txt'), paths[platform]) fs.writeFileSync(path.join(__dirname, 'path.txt'), paths[platform])
fs.writeFileSync(path.join(__dirname, 'run.bat'), shebang[platform]+'"'+paths[platform]+'" '+argv[platform]) fs.writeFileSync(path.join(__dirname, 'run.bat'), shebang[platform] + '"' + paths[platform] + '" ' + argv[platform])
extract(path.join(__dirname, name), {dir:path.join(__dirname, 'dist')}, function(err) { extract(path.join(__dirname, name), {dir: path.join(__dirname, 'dist')}, function (err) {
if (err) return onerror(err) if (err) return onerror(err)
}) })
}) })