summaryrefslogtreecommitdiff
path: root/.config/bash/rc.d/10_aliases.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/bash/rc.d/10_aliases.sh')
-rw-r--r--.config/bash/rc.d/10_aliases.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh
index f34230b..03ece7e 100644
--- a/.config/bash/rc.d/10_aliases.sh
+++ b/.config/bash/rc.d/10_aliases.sh
@@ -101,6 +101,24 @@ mvln() {
return 1
fi
}
+cpln() {
+ local target link
+ if [[ ! -L "$1" ]]; then
+ libremessages error 'Not a soft link: %s' "$1"
+ return 1
+ fi
+ if [[ -d "$2" ]]; then
+ link="$2/${1##*/}"
+ else
+ link="$2"
+ fi
+ target=$(readlink -f -- "$1") || return 1
+ ln -srT -- "$target" "$link"
+ if ! cmp -- "$1" "$link"; then
+ libremessages error 'Failed copying link: %s -> %s' "$1" "$link"
+ return 1
+ fi
+}
jarls() {
jar tf "$1" |
sed -n 's/\.class$//p' |