Tabs to two spaces.
This commit is contained in:
parent
0912f2d3d4
commit
03303c9e36
6 changed files with 49 additions and 49 deletions
58
cdz
58
cdz
|
|
@ -55,42 +55,42 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $NO_ARCHIVEMOUNT -eq 1 ]]; then
|
if [[ $NO_ARCHIVEMOUNT -eq 1 ]]; then
|
||||||
hasmounter=1
|
hasmounter=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $hasmounter == 0 )); then
|
if (( $hasmounter == 0 )); then
|
||||||
echo "We have \`archivemount\`, so we'll use that!"
|
echo "We have \`archivemount\`, so we'll use that!"
|
||||||
echo "If you'd prefer we not use it, please specify NO_ARCHIVEMOUNT=1"
|
echo "If you'd prefer we not use it, please specify NO_ARCHIVEMOUNT=1"
|
||||||
istar=1
|
istar=1
|
||||||
iszip=1
|
iszip=1
|
||||||
israr=1
|
israr=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now we set the right command
|
# Now we set the right command
|
||||||
if (( $istar == 0 )); then
|
if (( $istar == 0 )); then
|
||||||
comm2=(tar xvf "$target" -C)
|
comm2=(tar xvf "$target" -C)
|
||||||
elif (( $iszip == 0 )); then
|
elif (( $iszip == 0 )); then
|
||||||
which unzip 1>/dev/null
|
which unzip 1>/dev/null
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
if (( $exitcode == 0 )); then
|
if (( $exitcode == 0 )); then
|
||||||
comm2=(unzip -q "$target" -d)
|
comm2=(unzip -q "$target" -d)
|
||||||
else
|
else
|
||||||
comm1=(echo "The utility 'unzip' is missing, please install it")
|
comm1=(echo "The utility 'unzip' is missing, please install it")
|
||||||
comm3=(exit 1)
|
comm3=(exit 1)
|
||||||
fi
|
fi
|
||||||
elif (( $israr == 0 )); then
|
elif (( $israr == 0 )); then
|
||||||
which unrar 1>/dev/null
|
which unrar 1>/dev/null
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
if (( exitcode == 0 )); then
|
if (( exitcode == 0 )); then
|
||||||
comm2=(unrar -i nul "$target")
|
comm2=(unrar -i nul "$target")
|
||||||
else
|
else
|
||||||
comm1=(echo "The utility 'unrar' is missing, please install it")
|
comm1=(echo "The utility 'unrar' is missing, please install it")
|
||||||
comm3=(exit 1)
|
comm3=(exit 1)
|
||||||
fi
|
fi
|
||||||
elif (( $hasmounter == 0 )); then
|
elif (( $hasmounter == 0 )); then
|
||||||
comm2=(archivemount "$target")
|
comm2=(archivemount "$target")
|
||||||
comm4=(cd ..)
|
comm4=(cd ..)
|
||||||
comm5=(umount)
|
comm5=(umount)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the temp dir, usually
|
# Create the temp dir, usually
|
||||||
|
|
@ -106,9 +106,9 @@ cd $dir
|
||||||
|
|
||||||
# With archivemount, making a symlink will alter the archive
|
# With archivemount, making a symlink will alter the archive
|
||||||
if (( $hasmounter == 1 )); then
|
if (( $hasmounter == 1 )); then
|
||||||
ln -s $currentpath ./link-back
|
ln -s $currentpath ./link-back
|
||||||
echo "A symlink to your original path has been created under the name \`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 "You can use this to copy out files, but you can also just access your filesystem regularly."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Type 'exit' to exit the extracted archive's folder and auto-delete it."
|
echo "Type 'exit' to exit the extracted archive's folder and auto-delete it."
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ function ched()
|
||||||
then
|
then
|
||||||
if [[ $(realpath "$EDITOR") == "$EDITOR_REAL" ]];
|
if [[ $(realpath "$EDITOR") == "$EDITOR_REAL" ]];
|
||||||
then
|
then
|
||||||
available_editors+=("$EDITOR_REAL" "$editor (current choice)")
|
available_editors+=("$EDITOR_REAL" "$editor (current choice)")
|
||||||
else
|
else
|
||||||
available_editors+=("$EDITOR_REAL", "$editor")
|
available_editors+=("$EDITOR_REAL", "$editor")
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
2
filewait
2
filewait
|
|
@ -7,6 +7,6 @@ DAISY_INTERNAL=1
|
||||||
FILE=$@
|
FILE=$@
|
||||||
while [ ! -f "$FILE" ]
|
while [ ! -f "$FILE" ]
|
||||||
do
|
do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
echo $FILE
|
echo $FILE
|
||||||
|
|
|
||||||
2
newday
2
newday
|
|
@ -38,7 +38,7 @@ function errorFn()
|
||||||
echo "$BINSELF error ($ERROR): "
|
echo "$BINSELF error ($ERROR): "
|
||||||
perl -E 'say $!=shift' $ERROR
|
perl -E 'say $!=shift' $ERROR
|
||||||
fi
|
fi
|
||||||
exit $ERROR
|
exit $ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
# Error handling
|
# Error handling
|
||||||
|
|
|
||||||
26
shrc
26
shrc
|
|
@ -19,21 +19,21 @@ function md5_opt()
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $FROM_RC -eq 1 ]]; then
|
if [[ $FROM_RC -eq 1 ]]; then
|
||||||
alias shrc=". shrc"
|
alias shrc=". shrc"
|
||||||
else
|
else
|
||||||
BASENAME=$(basename $SHELL)
|
BASENAME=$(basename $SHELL)
|
||||||
RC_NAME="."$BASENAME"rc"
|
RC_NAME="."$BASENAME"rc"
|
||||||
RC_PATH="$HOME/$RC_NAME"
|
RC_PATH="$HOME/$RC_NAME"
|
||||||
|
|
||||||
# Optional MD5 checks
|
# Optional MD5 checks
|
||||||
HAS_CHANGED=1
|
HAS_CHANGED=1
|
||||||
SUM1=$(md5_opt "$RC_PATH")
|
SUM1=$(md5_opt "$RC_PATH")
|
||||||
SUM2=
|
SUM2=
|
||||||
|
|
||||||
# This sets a default if the variable does not exist.
|
# This sets a default if the variable does not exist.
|
||||||
EDITOR=${EDITOR:-$(ched)}
|
EDITOR=${EDITOR:-$(ched)}
|
||||||
$EDITOR "$RC_PATH"
|
$EDITOR "$RC_PATH"
|
||||||
wait_for_editor $EDITOR "$RC_PATH"
|
wait_for_editor $EDITOR "$RC_PATH"
|
||||||
|
|
||||||
SUM2=$(md5_opt "$RC_PATH")
|
SUM2=$(md5_opt "$RC_PATH")
|
||||||
|
|
||||||
|
|
@ -42,6 +42,6 @@ else
|
||||||
echo "The RC-file $RC_NAME has not changed on disk. Not sourcing."
|
echo "The RC-file $RC_NAME has not changed on disk. Not sourcing."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source "$RC_PATH"
|
source "$RC_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
8
sw
8
sw
|
|
@ -17,16 +17,16 @@ function helpFn()
|
||||||
fi
|
fi
|
||||||
echo "Usage: $DAISY_BIN <file1> <file2>"
|
echo "Usage: $DAISY_BIN <file1> <file2>"
|
||||||
echo Swap two files in a filesystem.
|
echo Swap two files in a filesystem.
|
||||||
exit $ERROR
|
exit $ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $@ == *"--help"* ]];
|
if [[ $@ == *"--help"* ]];
|
||||||
then
|
then
|
||||||
helpFn
|
helpFn
|
||||||
elif [[ $@ == '' ]];
|
elif [[ $@ == '' ]];
|
||||||
then
|
then
|
||||||
echo "No arguments specified."
|
echo "No arguments specified."
|
||||||
helpFn
|
helpFn
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We set a trap here, together with 'set -e' above,
|
# We set a trap here, together with 'set -e' above,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue