#
# Script by: Alec Posney (aposney@atlassian.com)
# To set "INSTALL_DIR" to location of this script
# Run this script, then
# Add ". $INSTALL_DIR/fishconfig_additions" to your config.fish
# Or run "echo '. '$INSTALL_DIR'/fishconfig_additions' >> ~/.config/fish/config.fish"
#

set INSTALL_DIR (cd (dirname (status -f));and  pwd)
set CLOUDTOKEN_DIR ${HOME}/.config/cloudtoken

alias cloudtoken "source $INSTALL_DIR/setcloudtoken.fish"
alias cloudunsettoken "source $INSTALL_DIR/unset_cloudtoken.fish; and rm -vf CLOUDTOKEN_DIR/cloud_tokens.shell; and rm -vf CLOUDTOKEN_DIR/cloud_tokens.json"

find $INSTALL_DIR/ -name cloud_tokens -mmin +60 -delete
find $INSTALL_DIR/ -name cloud_tokens.json -mmin +60 -delete

cd ~/

