Huge fix to cdz and added a symlink back to the original folder
This commit is contained in:
parent
ab4405cbd7
commit
a4438fe38e
1 changed files with 8 additions and 3 deletions
11
cdz
11
cdz
|
|
@ -33,6 +33,8 @@ echo $report | grep "tar archive" 1>/dev/null
|
||||||
istar=$?
|
istar=$?
|
||||||
echo $report | grep "Zip archive" 1>/dev/null
|
echo $report | grep "Zip archive" 1>/dev/null
|
||||||
iszip=$?
|
iszip=$?
|
||||||
|
echo $report | grep "Android" 1>/dev/null
|
||||||
|
iszip=$?
|
||||||
echo $report | grep "RAR archive" 1>/dev/null
|
echo $report | grep "RAR archive" 1>/dev/null
|
||||||
israr=$?
|
israr=$?
|
||||||
|
|
||||||
|
|
@ -40,7 +42,7 @@ israr=$?
|
||||||
# ...but it looks like tar and barks like tar, let's take the shot.
|
# ...but it looks like tar and barks like tar, let's take the shot.
|
||||||
# Seems to work fairly well for the record.
|
# Seems to work fairly well for the record.
|
||||||
RES=$(echo "$target" | grep ".tar")
|
RES=$(echo "$target" | grep ".tar")
|
||||||
if [[ RES != "" ]];
|
if [[ $RES != "" ]];
|
||||||
then
|
then
|
||||||
istar=0
|
istar=0
|
||||||
fi
|
fi
|
||||||
|
|
@ -76,8 +78,11 @@ dir=$(mktemp -d /tmp/extracted.XXXXXXXX)
|
||||||
"${comm2[@]}" $dir
|
"${comm2[@]}" $dir
|
||||||
"${comm3[@]}"
|
"${comm3[@]}"
|
||||||
|
|
||||||
|
currentpath=$(realpath .)
|
||||||
cd $dir
|
cd $dir
|
||||||
echo ""
|
ln -s $currentpath ./link-back
|
||||||
echo "Type 'exit' to exit the extracted archive's folder and auto-delete it"
|
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
|
eval $SHELL
|
||||||
rm -rf $dir
|
rm -rf $dir
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue