forked from prebuild/prebuildify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add test, that uses "real worlds scenario" by using really parsed options, not just artificially generated options - to make this tests possible, I had to factor the function, that parses teh args out, and make a separate file
- Loading branch information
Showing
5 changed files
with
67 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
}, | ||
"files": [ | ||
"bin.js", | ||
"index.js" | ||
"index.js", | ||
"parse.js" | ||
], | ||
"scripts": { | ||
"lint": "standard", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
var minimist = require('minimist') | ||
|
||
module.exports = parseArgs | ||
|
||
function parseArgs(argv) { | ||
|
||
var options = minimist(argv, { | ||
alias: { | ||
name: 'n', | ||
target: 't', | ||
version: 'v', | ||
all: 'a', | ||
napi: 'n-api', | ||
stripBin: 'strip-bin', | ||
nodeGyp: 'node-gyp', | ||
tagUv: 'tag-uv', | ||
tagArmv: 'tag-armv', | ||
tagLibc: 'tag-libc', | ||
electronCompat: 'electron-compat', | ||
cache: 'c' | ||
}, | ||
boolean: ['quiet', 'strip', 'napi', 'debug', 'all', 'electron-compat'], | ||
default: { | ||
napi: true | ||
} | ||
}) | ||
|
||
options.targets = [].concat(options.target || []) | ||
options.cwd = options.cwd || options._[0] || '.' | ||
|
||
return options | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters