At work, I run a command daily to return a specific token for access to our local repos. It's not a big deal, but I was trying to figure out a faster way of generating this token. Usually, I paste it into VSCode and run a Send Request via the REST Client Extension.
I'm trying to create a function in my .zsh profile that can then be run in my command line instead. Here's what I currently have:
generateToken() {
response=curl -H "Content-Type: application/json" -H "service-token: xxxx" -X POST -d '{"user": "me.myself@xxxxxxx.com"}' <the-url.com>
echo "$(response)"
}
Then I save, quit, and run eval ${generateToken}
, but nothing happens. Any suggestions on the best way to get this going?