Closed mritzco closed 3 years ago
Hi,
I'm getting an error on Windows on a couple of computers, error happens because prefix.length is too large for root directory.
Apparently the issue is that on Windows the symbol: ◯ is replaced for ( )
◯
( )
index.js #172
showValue = ' '.repeat(indent - prefix.length + 2) + prefix + itemPath.name + (itemPath.type === 'directory' ? path.sep : '') + '\n'
Testing code, add before line #172
const ind = indent - prefix.length + 2; console.log(ind, indent, prefix.length, prefix, itemPath.name); // Linux prints: 0 2 4 ↓ ◯ .(root directory) // Windows prints: -2 2 6 ↓ ( ) .(root directory) // temporary fix showValue = ' '.repeat(ind < 0 ? 0 : ind) + prefix + itemPath.name + (itemPath.type === 'directory' ? path.sep : '') + '\n'
Not sure what would be the best way to solve this issue as it comes from figures: https://www.npmjs.com/package/figures
I'll make a clone with the quick fix and can submit a pull request if this patch is the better option.
thanks ❤️
Hi,
I'm getting an error on Windows on a couple of computers, error happens because prefix.length is too large for root directory.
Apparently the issue is that on Windows the symbol:
◯
is replaced for( )
index.js #172
Testing code, add before line #172
Not sure what would be the best way to solve this issue as it comes from figures: https://www.npmjs.com/package/figures
I'll make a clone with the quick fix and can submit a pull request if this patch is the better option.