From 6e616a4107e0ab77b5a5114c01b1f0d908938cea Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 27 Apr 2018 13:59:53 +0200 Subject: [PATCH] added transfer shortcut --- zsh/.zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zsh/.zshrc b/zsh/.zshrc index bfa64c9..c25c726 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -88,6 +88,9 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" +transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi +tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://share.higherlearning.eu/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://share.higherlearning.eu/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; } + # Emberjs settings export PATH="$PATH:/home/alrayyes/.config/yarn/global/node_modules/.bin"