Skip to content

Commit e9d78e5

Browse files
author
Chris Raynor
committed
gracefully handling error caused by symlinks in directories - npm/fstream#16 fixes the underlying issue
1 parent 248bc07 commit e9d78e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/upload.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ module.exports = {
3838

3939
reader.addIgnoreRules(ignoreRules);
4040

41-
reader.pipe(tar.Pack())
41+
reader.on('error', function(err) {
42+
console.log(chalk.red('READ ERROR') + ' - Could not read directory. Remove' +
43+
' symbolic links / shortcuts and try again.');
44+
process.exit(1);
45+
}).pipe(tar.Pack())
4246
.pipe(zlib.createGzip())
4347
.pipe(writeStream);
4448

0 commit comments

Comments
 (0)