Skip to content

Commit

Permalink
use fs-extra copy instead of ncp
Browse files Browse the repository at this point in the history
Closes #213, #150, #151
  • Loading branch information
develar committed Apr 11, 2016
1 parent 100c72b commit e502853
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Object (also known as a "hash") of application metadata to embed into the execut

### `err`

*Error* (or *Array*, in the case of an `ncp` error)
*Error* (or *Array*, in the case of an `copy` error)

Contains errors, if any.

Expand Down
4 changes: 2 additions & 2 deletions mac.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module.exports = {
// Ignore error if icon doesn't exist, in case it's only available for other OS
cb(null)
} else {
ncp(icon, path.join(contentsPath, 'Resources', appPlist.CFBundleIconFile), cb)
fs.copy(icon, path.join(contentsPath, 'Resources', appPlist.CFBundleIconFile), cb)
}
})
})
Expand All @@ -175,7 +175,7 @@ module.exports = {
if (!Array.isArray(extras)) extras = [extras]
extras.forEach(function (val) {
operations.push(function (cb) {
ncp(val, path.join(contentsPath, 'Resources', path.basename(val)), cb)
fs.copy(val, path.join(contentsPath, 'Resources', path.basename(val)), cb)
})
})
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"fs-extra": "^0.26.5",
"get-package-info": "0.0.2",
"minimist": "^1.1.1",
"ncp": "^2.0.0",
"object-assign": "^4.0.1",
"plist": "^1.1.0",
"rcedit": "^0.5.0",
Expand Down
4 changes: 2 additions & 2 deletions test/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function createIgnoreOutDirTest (opts, distPath) {

series([
function (cb) {
ncp(path.join(__dirname, 'fixtures', 'basic'), appDir, {dereference: true, stopOnErr: true, filter: function (file) {
fs.copy(path.join(__dirname, 'fixtures', 'basic'), appDir, {dereference: true, stopOnErr: true, filter: function (file) {
return path.basename(file) !== 'node_modules'
}}, cb)
},
Expand Down Expand Up @@ -440,7 +440,7 @@ function createIgnoreImplicitOutDirTest (opts) {

series([
function (cb) {
ncp(path.join(__dirname, 'fixtures', 'basic'), appDir, {dereference: true, stopOnErr: true, filter: function (file) {
fs.copy(path.join(__dirname, 'fixtures', 'basic'), appDir, {dereference: true, stopOnErr: true, filter: function (file) {
return path.basename(file) !== 'node_modules'
}}, cb)
},
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"dependencies": {
"run-series": "^1.1.1"
},
"//": "ncp used to test https://github.com/electron-userland/electron-packager/pull/186",
"///": "(a module (with zero dependencies) that creates a file in node_modules/.bin)",
"devDependencies": {
"ncp": "^2.0.0",
"run-waterfall": "^1.1.1",
Expand Down

0 comments on commit e502853

Please sign in to comment.