Browse code

Fix error with gendl

Jaidyn Lev authored on 2019-01-21 22:15:46
Showing 1 changed files
... ...
@@ -54,7 +54,7 @@ function download_stdout
54 54
 			output="$(curl $url)"
55 55
 			;;
56 56
 		"wget")
57
-			output="$(wget --quiet -O $url)"
57
+			output="$(wget --quiet -O- $url)"
58 58
 			;;
59 59
 	esac
60 60
 
... ...
@@ -86,7 +86,7 @@ function download_file
86 86
 
87 87
 	return_code=$?
88 88
 
89
-	if test $return_code -ne 0
89
+	if test $return_code -ne 0 2>/dev/null
90 90
 	then
91 91
 		rm $path 2> /dev/null
92 92
 		# for consistency in behavior; wget saves 404s anyway, whereas
... ...
@@ -124,7 +124,7 @@ function usage
124 124
 # invocation
125 125
 
126 126
 args="$(getopt o: $*)"
127
-if test $? -ne 0 || test -z "$@"
127
+if test -z "$@" 2>/dev/null
128 128
 then
129 129
 	usage
130 130
 	exit 2
... ...
@@ -147,7 +147,7 @@ done
147 147
 url="$(last_word "$@")"
148 148
 
149 149
 
150
-if test -n "$download_path"
150
+if test -n "$download_path" 2> /dev/null
151 151
 then
152 152
 	download_file $url $download_path
153 153
 else