1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-21 11:01:31 +01:00

zsh: functions: fix upload()

This commit is contained in:
bretello 2023-07-10 09:12:50 +02:00
parent d72886b6c1
commit 9ccf8699ec
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -121,14 +121,14 @@ function upload
echo -e "Done, file at:\t$out"
if [[ $(uname) == "Darwin" ]]; then
clipboard="pbcopy"
elif command -v wl-copy; then
elif command -v wl-copy &>/dev/null; then
clipboard="wl-copy"
elif command -v xclip; then
elif command -v xclip &>/dev/null ; then
clipboard="xclip"
else
clipboard="cat"
fi
echo -n"$out" | $clipboard
echo -en "$out" | $clipboard
}
## If connecting through ssh and reverse forwarding port 2222 (ssh -R 2222:localhost:22 ), this function allows to copy the files back to the machine one is connecting from by typing 'mecp filename' (configure the username for "localhost" in ~/.ssh/config or add an username)