diff options
Diffstat (limited to 'alias')
-rw-r--r-- | alias | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -410,10 +410,12 @@ image.from_data_url() { | |||
410 | identify $1 | 410 | identify $1 |
411 | } | 411 | } |
412 | image.upload() { | 412 | image.upload() { |
413 | month=$(date +%Y-%m) | 413 | local month=$(date +%Y-%m) |
414 | filename=${2:-$(date +"%d_%Hh%Mm%Ss").${1##*.}} | 414 | local filename=${2:-$(date +"%d_%Hh%Mm%Ss").${1##*.}} |
415 | scp $1 vps:~/data/s3.photos/$month/$filename | 415 | local fpath='$HOME/data/s3.photos/'$month |
416 | echo https://topo.tw/photos/$month/$filename | 416 | cat $1 | ssh vps "mkdir -p $fpath && cat >$fpath/$filename" && \ |
417 | echo https://topo.tw/photos/$month/$filename || \ | ||
418 | echo Fail to upload | ||
417 | } | 419 | } |
418 | image.text() { | 420 | image.text() { |
419 | convert \ | 421 | convert \ |