From 96c161f12d3da44e8e0bfdbfdd9aa50a18957521 Mon Sep 17 00:00:00 2001 From: wsq Date: Tue, 23 Jul 2019 16:40:37 +0800 Subject: [PATCH] qiniu_uploader cmd --- zsh/functions.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 60feb01..79bc8bd 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -130,6 +130,26 @@ function init_db() { dc exec $1 rails db:drop db:create db:migrate db:seed } +function qiniu_uploader() { + bucket='' + filepath='' + while getopts "b:f:" o; do + case "${o}" in + b) + bucket=${OPTARG} + ;; + f) + filepath=${OPTARG} + ;; + *) + echo "Usage: -b BUCKET -f FILEPATH" + return + ;; + esac + done + ruby ~/Projects/paiyou-hub/bin/qiniu_uploader.rb -b $bucket -f $filepath +} + function gitcopy() { n=1 while getopts "c:n:t:T" o; do