mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-23 07:08:28 +00:00
add --ignore support
This commit is contained in:
parent
4c08efb6a1
commit
b1e2e80dbb
13
index.js
13
index.js
@ -74,8 +74,19 @@ module.exports = function packager (opts, cb) {
|
||||
fs.writeFileSync(paths.info1, plist.build(pl1))
|
||||
fs.writeFileSync(paths.info2, plist.build(pl2))
|
||||
|
||||
function filter(file) {
|
||||
var ignore = opts.ignore || []
|
||||
if (!Array.isArray(ignore)) ignore = [ignore]
|
||||
for (var i = 0; i < ignore.length; i++) {
|
||||
if (file.match(ignore[i])) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// copy users app into .app
|
||||
ncp(opts.dir, paths.app, opts, function copied (err) {
|
||||
ncp(opts.dir, paths.app, {filter: filter}, function copied (err) {
|
||||
if (err) return cb(err)
|
||||
|
||||
// finally, move app into cwd
|
||||
|
@ -23,6 +23,8 @@ This will:
|
||||
|
||||
You should be able to double-click `AppName.app` to launch the app. If not, check your settings and try again.
|
||||
|
||||
**Be careful** not to include node_modules you don't want into your final app. For example, do not include the `node_modules/atom-shell-packager` folder or `node_modules/atom-shell`. You can use `--ignore=node_modules/atom-shell` to ignore of these
|
||||
|
||||
### options
|
||||
|
||||
these are optional CLI options you can pass in
|
||||
@ -31,5 +33,4 @@ these are optional CLI options you can pass in
|
||||
- `version` (default hardcoded in source) - atom-shell version to use
|
||||
- `app-bundle-id` - bundle identifier to use in the app plist
|
||||
- `helper-bundle-id` - bundle identifier to use in the app helper plist
|
||||
|
||||
also, the entire `options` objects gets passed into the [`ncp`](https://npmjs.org/ncp) instance when copying your app source directory into the app container, so you can pass in any `ncp` options you want as well
|
||||
- `ignore` (default none) - do not copy files into App whose filenames regex .match this string
|
||||
|
Loading…
x
Reference in New Issue
Block a user