- Many fixes to sourcing, now will always resolve to base dir.

- All scripts are again `sh` compatible.
- Binbox overhaul, symlinks finally work just like `busybox`.
- Error checking to some files like `sw` and `own`.
TODO: Make it pretty and make `short` already.
This commit is contained in:
Sam Hardeman 2025-09-22 08:34:50 +02:00
parent b5c8a3f894
commit 0912f2d3d4
13 changed files with 1143 additions and 33 deletions

15
sw
View file

@ -1,6 +1,9 @@
#!/bin/sh
# It just swaps two files
export DAISY_INTERNAL=1
. $(dirname $(realpath $0))/daisy.source
FILE1=$1
FILE2=$2
@ -9,17 +12,21 @@ function helpFn()
ERROR=$?
if [[ $ERROR -gt 0 ]];
then
echo "$BINSELF error ($ERROR): "
perl -E 'say $!=shift' $ERROR
ERROR_TEXT=$(perl -E 'say $!=shift' $ERROR)
echo "$DAISY_BIN error ($ERROR): $ERROR_TEXT"
fi
echo "Usage: $BINSELF <file1> <file2>"
echo "Usage: $DAISY_BIN <file1> <file2>"
echo Swap two files in a filesystem.
exit $ERROR
}
if [[ $@ == *"--help"* ]];
if [[ $@ == *"--help"* ]];
then
helpFn
elif [[ $@ == '' ]];
then
echo "No arguments specified."
helpFn
fi
# We set a trap here, together with 'set -e' above,