From a4438fe38e03ab68cd7f2f8b9e59f7db3a0f3bca Mon Sep 17 00:00:00 2001 From: Sam Hardeman Date: Sat, 13 Sep 2025 16:35:42 +0200 Subject: [PATCH] Huge fix to cdz and added a symlink back to the original folder --- cdz | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cdz b/cdz index 170076c..fd25010 100755 --- a/cdz +++ b/cdz @@ -33,6 +33,8 @@ echo $report | grep "tar archive" 1>/dev/null istar=$? echo $report | grep "Zip archive" 1>/dev/null iszip=$? +echo $report | grep "Android" 1>/dev/null +iszip=$? echo $report | grep "RAR archive" 1>/dev/null israr=$? @@ -40,7 +42,7 @@ israr=$? # ...but it looks like tar and barks like tar, let's take the shot. # Seems to work fairly well for the record. RES=$(echo "$target" | grep ".tar") -if [[ RES != "" ]]; +if [[ $RES != "" ]]; then istar=0 fi @@ -76,8 +78,11 @@ dir=$(mktemp -d /tmp/extracted.XXXXXXXX) "${comm2[@]}" $dir "${comm3[@]}" +currentpath=$(realpath .) cd $dir -echo "" -echo "Type 'exit' to exit the extracted archive's folder and auto-delete it" +ln -s $currentpath ./link-back +echo "A symlink to your original path has been created under the name \`link-back\`." +echo "You can use this to copy out files, but you can also just access your filesystem regularly." +echo "Type 'exit' to exit the extracted archive's folder and auto-delete it." eval $SHELL rm -rf $dir