Browse Source

replaced run.bat with cli.js closes #9

James Kyburz 10 years ago
parent
commit
0b0472a999
4 changed files with 8 additions and 16 deletions
  1. 7 0
      npm/cli.js
  2. 0 13
      npm/install.js
  3. 1 1
      npm/package.json
  4. 0 2
      npm/run.bat

+ 7 - 0
npm/cli.js

@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+var electron = require('./')
+
+var proc = require('child_process')
+
+proc.spawn(electron, process.argv.slice(2), {stdio: 'inherit'});

+ 0 - 13
npm/install.js

@@ -22,24 +22,11 @@ var paths = {
   win32: path.join(__dirname, './dist/electron.exe')
 }
 
-var shebang = {
-  darwin: '#!/bin/bash\n',
-  linux: '#!/bin/bash\n',
-  win32: ''
-}
-
-var argv = {
-  darwin: '"$@"',
-  linux: '"$@"',
-  win32: '%*' // does this work with " " in the args?
-}
-
 if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
 
 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, filename), {dir: path.join(__dirname, 'dist')}, function (err) {
     if (err) return onerror(err)
   })

+ 1 - 1
npm/package.json

@@ -11,7 +11,7 @@
     "test": "tape test/*.js"
   },
   "bin": {
-    "electron": "run.bat"
+    "electron": "cli.js"
   },
   "main": "index.js",
   "dependencies": {

+ 0 - 2
npm/run.bat

@@ -1,2 +0,0 @@
-#!/bin/bash
-"/Users/maxogden/src/js/electron-prebuilt/dist/Electron.app/Contents/MacOS/Electron" "$@"