diff --git a/package.json b/package.json index 51ebab8..4a4e596 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,9 @@ "prepublish": "npm run compile", "test": "npm run compile && mocha test-dist/*" }, + "bin": { + "electron-rebuild": "lib/cli.js" + }, "repository": { "type": "git", "url": "https://github.com/paulcbetts/electron-rebuild" @@ -27,6 +30,7 @@ "ncp": "^2.0.0", "npm": "^2.9.0", "promise": "^7.0.1", - "rimraf": "^2.3.3" + "rimraf": "^2.3.3", + "yargs": "^3.8.0" } } diff --git a/src/main.js b/src/main.js index 3341c88..b8bdb96 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,4 @@ -require('babel-core'); +require('babel/polyfill'); import path from 'path'; import _ from 'lodash'; @@ -56,7 +56,7 @@ export async function installNodeHeaders(nodeVersion, nodeDistUrl=null, headersD await spawnWithHeadersDir(cmd, args, headersDir); } -export async function rebuildNativeModules(nodeVersion, nodeModulesPath=null, headersDir=null) { +export async function rebuildNativeModules(nodeVersion, nodeModulesPath, headersDir=null) { headersDir = headersDir || getHeadersRootDirForVersion(nodeVersion); await checkForInstalledHeaders(nodeVersion, headersDir);