setup/destination: tiny fixes

This commit is contained in:
Vincent Riquer 2013-06-19 12:54:05 +02:00
parent 4822d95760
commit c81f1879fc

View File

@ -222,18 +222,19 @@ setupDestination() {
Leave blank if you don't want file renaming.
EODesc
initialvalue="${destinationrenamepath["$destination"]}"
initialvalue+="${initialvalue+/}"
initialvalue+=/
[[ $initialvalue == / ]] && unset initialvalue
initialvalue+="${destinationrename["$destination"]}"
[ -z "$initialvalue" ] && unset initialvalue
read \
-e \
${initialvalue+-i"$initialvalue"} \
-p'Rename pattern: ' \
value
case "$value" in
*/*)
if [[ $value =~ / ]]
then
destinationrenamepath["$destination"]="${value%/*}"
;;
esac
fi
destinationrename["$destination"]="${value##*/}"
cat <<-EODesc
@ -272,12 +273,13 @@ setupDestination() {
This prompt will loop until an empty string is encountered.
EODesc
destinationskipmime["$destination"]="${destinationskipmime["$destination"]}|"
while [[ ${destinationskipmime["$destination"]} =~ / ]]
while [[ ${destinationskipmime["$destination"]} =~ \| ]]
do
skippedmimes+=("${destinationskipmime["$destination"]%%|*}")
destinationskipmime["$destination"]="${destinationskipmime["$destination"]#*|}"
done
[ -n "${destinationskipmime["$destination"]}" ] \
&& skippedmimes+=("${destinationskipmime["$destination"]}")
count=${#skippedmimes[@]}
unset destinationskipmime["$destination"]
for (( i=0 ; 1 ; i++ ))
@ -307,12 +309,13 @@ setupDestination() {
This prompt will loop until an empty string is encountered.
EODesc
destinationcopymime["$destination"]="${destinationcopymime["$destination"]}|"
while [[ ${destinationcopymime["$destination"]} =~ / ]]
while [[ ${destinationcopymime["$destination"]} =~ \| ]]
do
copiedmimes+=("${destinationcopymime["$destination"]%%|*}")
destinationcopymime["$destination"]="${destinationcopymime["$destination"]#*|}"
done
[ -n "${destinationcopymime["$destination"]}" ] \
&& copiedmimes+=("${destinationcopymime["$destination"]}")
count=${#copiedmimes[@]}
unset destinationcopymime["$destination"]
for (( i=0 ; 1 ; i++ ))