#!/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
