- 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:
parent
b5c8a3f894
commit
0912f2d3d4
13 changed files with 1143 additions and 33 deletions
15
sw
15
sw
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue