Allow symlinks in clipboard

This commit is contained in:
2020-01-28 15:40:41 +02:00
parent 6fc62b9e2a
commit 4b499512d0

View File

@@ -148,7 +148,7 @@ _read_menu() {
NAME=${NAME#\"}
NAME=${NAME%\'}
NAME=${NAME%\"}
if [[ -e "$STORAGE/$NAME" ]]; then
if [[ -e "$STORAGE/$NAME" || -L "$STORAGE/$NAME" ]]; then
NAME=$( basename "$NAME" )
_read
else
@@ -202,12 +202,12 @@ _read_stdout() { # name
}
_delete() { # name
[[ -e "$STORAGE/$1" ]] || {
[[ -e "$STORAGE/$1" || -L "$STORAGE/$1" ]] || {
_msg No such clipboard
exit 1
}
[[ "$FORCE" -ne 1 ]] && {
read -p "Really delete $1 ? Break to cancel. " foo
read -p "Really delete '$1' ? Break to cancel. " foo
}
echo Deleting "$1"
rm -rf "$STORAGE/$1"
@@ -218,7 +218,7 @@ _delete_all() {
exit 0
}
[[ "$FORCE" -ne 1 ]] && {
read -p "Really delete $STORAGE ? Break to cancel. " foo
read -p "Really delete the whole clipboard? ($STORAGE) Break to cancel. " foo
}
rm -vrf "$STORAGE/"
mkdir "$STORAGE"
@@ -250,7 +250,7 @@ _get_file() {
_edit() {
EDITOR=${EDITOR:-vi}
[[ -d "$STORAGE/$NAME" ]] && {
[[ -f "$STORAGE/$NAME" ]] || {
_msg "$NAME is a directory, can not edit"
exit 1
}