Check for failure when running wget
authorIan Lynagh <igloo@earth.li>
Tue, 20 Oct 2009 20:25:16 +0000 (20:25 +0000)
committerIan Lynagh <igloo@earth.li>
Tue, 20 Oct 2009 20:25:16 +0000 (20:25 +0000)
darcs-all

index 69445d0..a80e6f8 100644 (file)
--- a/darcs-all
+++ b/darcs-all
@@ -118,6 +118,12 @@ sub download {
     my @cmd = ("wget", $from, "-O", $to);
     message "== running @cmd";
     system @cmd;
+    if ($? == -1) {
+        die "Failed to execute wget: $!\n";
+    }
+    elsif ($? != 0) {
+        die "wget failed: $?\n";
+    }
 }
 
 sub darcs {