GreenImp / laravel-foundation

NodeJS script for installing Laraval and Foundation as a package.
MIT License
0 stars 0 forks source link

node-merge can't handle directories #1

Closed GreenImp closed 6 years ago

GreenImp commented 9 years ago

Originally reported by: Lee Langley (Bitbucket: LeeLangleyRees, GitHub: Unknown)


If node merge finds a directory inside the one it is copying from, it throws an error:

#!bash

ReferenceError: merge is not defined
    at Object.exports.mergeTo (/path/to/script/node_modules/node-merge/merge.js:16:21)

The issue is caused by it incorrectly trying to recursively call itself, on line 16 of merge.js:

#!javascript

_results.push(merge("" + f1 + "/" + file, "" + f2 + "/" + file));

There is no such function as merge(). I'm not sure if it's correct, but replacing merge with exports.mergeTo fixes the issue:

#!javascript

_results.push(exports.mergeTo("" + f1 + "/" + file, "" + f2 + "/" + file));

I'm not wanting to modify the code though, as it's part of a separate node module.

I see three options:

  1. Create an issue with the developer, and get them to fix it. Unlikely to resolve, as it hasn't been updated in three years.
  2. Fork the repo and fix it myself. Would work, but I'm not wanting to manage a whole repo for such a minor fix.
  3. Look into alternative modules.

GreenImp commented 9 years ago

Original comment by Lee Langley (Bitbucket: LeeLangleyRees, GitHub: Unknown):


Just for reference, the forked version is on my Github account: https://github.com/GreenImp/node-merge

GreenImp commented 9 years ago

Original comment by Lee Langley (Bitbucket: LeeLangleyRees, GitHub: Unknown):


Changes node-merge to forked version

resolves issue #1