Latest version

This commit is contained in:
Sam Hardeman 2026-03-08 20:54:07 +01:00
parent e3a2efdb43
commit eb0aab1613
17 changed files with 815 additions and 328 deletions

22
cdz
View file

@ -1,8 +1,8 @@
#!/bin/sh
#!/usr/bin/env bash
if [[ $LD_INTERNAL -ne 1 ]];
then
export LD_INTERNAL=1
LD_INTERNAL=1
. $(dirname $(realpath $0))/daisy.source
fi
@ -28,6 +28,7 @@ hasmounter=$?
file "$target" 1>/dev/null
exitcode=$?
report=$(file "$target")
name=$(echo $@ | sed 's/:.*//' | sed 's|.*/||')
# Check for archive type, supported types are zip/tar/rar
comm1=(:)
@ -88,7 +89,7 @@ elif (( $israr == 0 )); then
comm3=(exit 1)
fi
elif (( $hasmounter == 0 )); then
comm2=(archivemount "$target")
comm2=(archivemount -o allow_root -o use_ino "$target")
comm4=(cd ..)
comm5=(umount)
fi
@ -101,18 +102,17 @@ dir=$(mktemp -d /tmp/extracted.XXXXXXXX)
"${comm2[@]}" $dir
"${comm3[@]}"
currentpath=$(realpath .)
cd $dir
currentpath=$(pwd)
sym="$currentpath/$name.tmp"
ln -f -s "$dir" "$sym"
cd "$sym"
# With archivemount, making a symlink will alter the archive
if (( $hasmounter == 1 )); then
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."
fi
echo "A symlink has been made under the name \"$sym\"."
echo "This symlink points to the data directory \"$dir\"."
echo "Type 'exit' to exit the extracted archive's folder and auto-delete it."
eval $SHELL
"${comm4[@]}"
"${comm5[@]}" $dir
rm -rf $dir
rm "$sym"