Huge fix to cdz and added a symlink back to the original folder

This commit is contained in:
Sam Hardeman 2025-09-13 16:35:42 +02:00
parent ab4405cbd7
commit a4438fe38e

11
cdz
View file

@ -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