Don't use working directory when --output-directory option is used
[grml-hwinfo.git] / grml-hwinfo
index 48b9676..75567b2 100755 (executable)
@@ -112,7 +112,12 @@ fi
 
 # Generate output/temporary directory name & path, and output file path
 [ -n "$OUTDIRNAME" ] || OUTDIRNAME="grml-hwinfo-${DATE}"
-OUTDIR="${WORKING_DIR}/${OUTDIRNAME}"
+if $_opt_output_directory ; then
+  OUTDIR="${OUTDIRNAME}"
+else
+  OUTDIR="${WORKING_DIR}/${OUTDIRNAME}"
+fi
+
 if $_opt_force ; then
   mkdir -p "${OUTDIR}"
 else