fixed fortune reference to ananova, cleaned up somewhat final version of unpack script.
[feisty_meow.git] / scripts / archival / unpack.sh
index cabb65d397dc5b0fb4c91a6f77ebc83c84aba36c..dfa3d1c34c21034fda4aad81a9e45e93b7aa3fec 100644 (file)
@@ -37,7 +37,7 @@ if [ ! -d "$unpack_dir" ]; then
 fi
 
 # save where we started out.
-ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && \pwd )"
+ORIGINATING_FOLDER="$( \pwd )"
 
 pushd "$unpack_dir" &>/dev/null
 
@@ -51,13 +51,12 @@ if [ ! -f "$unpack_file" ]; then
   fi
 fi
 
-if [[ $unpack_file =~ .*\.tar ]]; then
-  tar -f $unpack_file
-elif [[ $unpack_file =~ .*\.tar\.gz \
-    || $unpack_file =~ .*\.tar\.bz2 \
-    || $unpack_file =~ .*\.tgz ]]; then
+if [[ $unpack_file =~ .*\.tar$ \
+    || $unpack_file =~ .*\.tar\.gz$ \
+    || $unpack_file =~ .*\.tar\.bz2$ \
+    || $unpack_file =~ .*\.tgz$ ]]; then
   tar -xf $unpack_file
-elif [[ $unpack_file =~ .*\.zip ]]; then
+elif [[ $unpack_file =~ .*\.zip$ ]]; then
   unzip $unpack_file
 fi
 save_err=$?