findup icon indicating copy to clipboard operation
findup copied to clipboard

Endless loop on windows and FindUp.sync

Open mgreter opened this issue 8 years ago • 1 comments

Related to: https://github.com/Filirom1/findup/issues/4 and https://github.com/Filirom1/findup/pull/5 Got that bug while working with gulp-rtlcss and tracked it down: https://github.com/Filirom1/findup/blob/master/index.js#L96 Demo repo: https://github.com/mgreter/bug-gulp-rtl-with-cwd

mgreter avatar Oct 26 '16 18:10 mgreter

Boils down to the following:

var root = 'directory';
console.log('root 0: ', root);
root = Path.join(root, '..');
console.log('root 1: ', root);
root = Path.join(root, '..');
console.log('root 2: ', root);
root = Path.join(root, '..');
console.log('root 3: ', root);

Gives:

root 0:  directory
root 1:  .
root 2:  ..
root 3:  ..\..

Version:

$ node -v
v4.5.0

mgreter avatar Oct 26 '16 18:10 mgreter