Browse Source

use standard js style

Max Ogden 10 years ago
parent
commit
1809db5669
3 changed files with 15 additions and 11 deletions
  1. 5 1
      npm/CONTRIBUTING.md
  2. 1 1
      npm/index.js
  3. 9 9
      npm/install.js

+ 5 - 1
npm/CONTRIBUTING.md

@@ -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)

+ 1 - 1
npm/index.js

@@ -1,4 +1,4 @@
 var fs = require('fs')
 var path = require('path')
 
-module.exports = fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8')
+module.exports = fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8')

+ 9 - 9
npm/install.js

@@ -8,15 +8,15 @@ var fs = require('fs')
 
 var platform = os.platform()
 var arch = os.arch()
-if ('win32' === platform) {
+if (platform === 'win32') {
   // 64-bit is not available under windows.
-  arch = 'ia32';
+  arch = 'ia32'
 }
 var version = '0.21.3'
-var name = '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 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 onerror = function(err) {
+function onerror (err) {
   throw err
 }
 
@@ -38,13 +38,13 @@ var argv = {
   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)
   fs.writeFileSync(path.join(__dirname, 'path.txt'), paths[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) {
+  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) {
     if (err) return onerror(err)
   })
 })