aboutsummaryrefslogtreecommitdiffhomepage
path: root/alias
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2022-12-09 11:23:29 +0800
committerHsieh Chin Fan <pham@topo.tw>2022-12-09 11:23:29 +0800
commit3cea0984eb7d1caed8252ae674ded2c1a97b7ae0 (patch)
treee54304f4e3c65b45e1a53ad70e161d2064ab9863 /alias
parent5adf5991d2bbcf5bd3feb7496bbda49a8aedca05 (diff)
Fix folder creation issue
Diffstat (limited to 'alias')
-rw-r--r--alias10
1 files changed, 6 insertions, 4 deletions
diff --git a/alias b/alias
index 0c8d38a..fe45c29 100644
--- a/alias
+++ b/alias
@@ -410,10 +410,12 @@ image.from_data_url() {
410 identify $1 410 identify $1
411} 411}
412image.upload() { 412image.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}
418image.text() { 420image.text() {
419 convert \ 421 convert \