MacOS set MarkText and PicGo
192:~ xxx$ picgo -h
Usage: picgo [options] [command]
Options:
-v, --version output the version number
-d, --debug debug mode
-s, --silent silent mode
-c, --config <path> set config path
-p, --proxy <url> set proxy for uploading
-h, --help display help for command
Commands:
install|add [options] <plugins...> install picgo plugin
uninstall|rm <plugins...> uninstall picgo plugin
update [options] <plugins...> update picgo plugin
set|config <module> [name] configure config of picgo modules
upload|u [input...] upload, go go go
use [module] use modules of picgo
init [options] <template> [project] create picgo plugin's development
templates
i18n [lang] change picgo language
help [command] display help for command
192:~ xxx$ picgo set uploader
? Choose a(n) uploader aliyun
? accessKeyId: xxxxxxxxxxx
? accessKeySecret: [hidden]
? bucket: image-zxl
设定存储区域 例如:oss-cn-beijing oss-cn-hangzhou
设定存储路径 例如:test/ pico/imgs/
设定自定义域名 例如:https://test.com https://ixxxx.oss-cn-hangzhou.aliyuncs设定网址后缀 例如:?x-oss-process=xxx
[PicGo SUCCESS]: Configure config successfully!
[PicGo INFO]: If you want to use this config, please run 'picgo use uploader'
192:~ xxx$ pic use uploader
pic:fatal error: can't open `use': No such file or directory
192:~ xxx$ picgo use uploader
? Use an uploader aliyun
[PicGo SUCCESS]: Configure config successfully!
192:~ xxx$ picgo u
[PicGo INFO]: Before transform
[PicGo INFO]: Transforming... Current transformer is [path]
[PicGo INFO]: Before upload
[PicGo INFO]: Uploading... Current uploader is [aliyun]
[PicGo SUCCESS]:
https://xxxl.oss-cn-hangzhou.aliyuncs.com/pxxx0225204856.png
192:~ xxx$
192:~ xxx$ cat picgo_upload.sh
#!/bin/bash
#source /etc/profile
#picgo u
#!/bin/bashsource/etc/profileexportLANG="en_US.UTF-8"img="$(~/.npm-global/bin/picgo u$1)"echo$img|awk'{print $NF}'
#picgo u $1
source /etc/profile
export LANG="en_US.UTF-8"
img="$(picgo u $1)"
echo $img | awk '{print $NF}'
Ref:
MarkText提示“your system does not have picgo installed”解决办法
第五步:准备一个sh脚本,比如我的picgo_upload.sh,并给执行权限,如chmod 755 picgo_upload.sh
#!/bin/bashsource/etc/profileexportLANG=“en_US.UTF-8"img=”$(~/.npm-global/bin/picgo u 1 ) " e c h o 1)"echo 1)"echoimg|awk’{print $NF}’
作者:阿广本尊
链接:https://www.jianshu.com/p/e44d288d5020
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。