From 8d2f11d9beb219e8754618d098bece768187d206 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 4 Mar 2015 18:36:47 -0800 Subject: [PATCH] Handle bad symlinks properly Regression introduced by pulling in glob as a dep, due to root cause https://github.com/isaacs/node-glob/issues/170. Added good and bad symlinks to test, which would have caught this. Fixes #65 Fixes https://github.com/ember-cli/ember-cli/issues/3413 --- package.json | 2 +- test/run.sh | 4 ++++ test/setup.sh | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1b157188..9b6951f6 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "bin": "./bin.js", "dependencies": { - "glob": "^4.4.1" + "glob": "^4.4.2" }, "files": [ "bin.js", diff --git a/test/run.sh b/test/run.sh index 653ff9b7..eb3fab55 100644 --- a/test/run.sh +++ b/test/run.sh @@ -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 diff --git a/test/setup.sh b/test/setup.sh index 2602e631..df3a042b 100644 --- a/test/setup.sh +++ b/test/setup.sh @@ -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