summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-07-24 17:39:36 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-07-24 17:39:36 +0800
commit66c03d2ade3ff0de2b1b1a92c3f99396010af9e6 (patch)
tree737c78439b1ab6a98f44c13d8dc66395ab5cad6d
parentcb34c67a19dde8eb6e4ec1d1137cba75e11ee8e8 (diff)
.zshrc: optional arg for target filename
-rw-r--r--.zshrc10
1 files changed, 8 insertions, 2 deletions
diff --git a/.zshrc b/.zshrc
index ff3f3be..7ed0a94 100644
--- a/.zshrc
+++ b/.zshrc
@@ -19,8 +19,14 @@ export PATH="$HOME/.local/bin:$PATH"
# utilities
share () {
- scp -r $1 www@fkfd.me:www/static/
- echo "https://fkfd.me/static/$(urlencode $(basename $1))"
+ src=$1
+ if [[ $2 == '' ]]; then
+ dst=$1
+ else
+ dst=$2
+ fi
+ scp -r $src www@fkfd.me:www/static/$dst
+ echo "https://fkfd.me/static/$(urlencode $(basename $dst))"
}
bright () {