feat: add fish functions
This commit is contained in:
parent
8fe5a249b0
commit
053876bb52
2 changed files with 28 additions and 0 deletions
14
home/private_dot_config/private_fish/functions/img2c.fish
Normal file
14
home/private_dot_config/private_fish/functions/img2c.fish
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/fish
|
||||
function img2c --description "Upload images to cloud, powered by picgo"
|
||||
if ! type -t picgo &> /dev/null
|
||||
set --function PICGO_PATH $HOME/ws/bin/piclist/node_modules/piclist/bin/picgo # change to your picgo binary path if needed
|
||||
end
|
||||
if ! test -d $HOME/.picgo -a -d $HOME/.piclist
|
||||
set --function PICGO_DATA /home/grassblock/ws/bin/piclist/data/ # change to a directory that contains the .picgo / .piclist directory
|
||||
end
|
||||
if ! count $argv > /dev/null
|
||||
echo "please provide a image path"
|
||||
else
|
||||
HOME=$PICGO_DATA $PICGO_PATH -s upload $argv[1]
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue