Handle tsort failure.
authorIain Patterson <me@iain.cx>
Fri, 28 May 2010 14:45:46 +0000 (15:45 +0100)
committerIain Patterson <me@iain.cx>
Fri, 28 May 2010 14:46:15 +0000 (15:46 +0100)
If tsort fails just source the scripts in the order they're found.

.bash_profile

index 49ea904..b10aba7 100644 (file)
@@ -46,7 +46,11 @@ $i"
 ${deps##*
 }"
   fi
-  deps=$(echo "$deps" | tsort)
+  sorted=$(echo "$deps" | tsort)
+  if [ -n "$sorted" ]; then
+    deps="$sorted"
+    unset sorted
+  fi
   deps="$required
 $deps"