Skip to content

Commit

Permalink
Handle bad symlinks properly
Browse files Browse the repository at this point in the history
Regression introduced by pulling in glob as a dep, due to root cause
isaacs/node-glob#170.

Added good and bad symlinks to test, which would have caught this.

Fixes #65
Fixes ember-cli/ember-cli#3413
  • Loading branch information
isaacs committed Mar 5, 2015
1 parent e4e9dcb commit 8d2f11d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"bin": "./bin.js",
"dependencies": {
"glob": "^4.4.1"
"glob": "^4.4.2"
},
"files": [
"bin.js",
Expand Down
4 changes: 4 additions & 0 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ for i in test-*.js; do
echo -n $i ...
bash setup.sh
node $i
if [ $? -ne 0 ]; then
echo "fail"
code=1
fi
if [ -d target ]; then
echo "fail"
code=1
Expand Down
6 changes: 6 additions & 0 deletions test/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ fill () {
let f--
done

# valid symlink
ln -s "f-$depth-1" "$target/link-$depth-good"

# invalid symlink
ln -s "does-not-exist" "$target/link-$depth-bad"

let depth--

if [ $depth -le 0 ]; then
Expand Down

0 comments on commit 8d2f11d

Please sign in to comment.