diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2022-12-09 11:23:29 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2022-12-09 11:23:29 +0800 |
| commit | 3cea0984eb7d1caed8252ae674ded2c1a97b7ae0 (patch) | |
| tree | e54304f4e3c65b45e1a53ad70e161d2064ab9863 /alias | |
| parent | 5adf5991d2bbcf5bd3feb7496bbda49a8aedca05 (diff) | |
Fix folder creation issue
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 \ |