Skip to content

Instantly share code, notes, and snippets.

@ChenTanyi
Last active September 22, 2020 07:31
Show Gist options
  • Save ChenTanyi/bdf9f3b86baf2ffaea0921a03c89a028 to your computer and use it in GitHub Desktop.
Save ChenTanyi/bdf9f3b86baf2ffaea0921a03c89a028 to your computer and use it in GitHub Desktop.
azureexport() {
if [[ $# < 2 ]]; then
echo "export <key> <env_key>"
return
fi
export $2=`python -c 'import os, json, sys; print(json.load(open(os.environ["AZURE_AUTH_LOCATION"]))[sys.argv[1]])' $1`
}
azureexportall() {
azureexport clientId AZURE_CLIENT_ID
azureexport clientSecret AZURE_CLIENT_SECRET
azureexport tenantId AZURE_TENANT_ID
azureexport subscriptionId AZURE_SUBSCRIPTION_ID
}
gulpgenj() {
if [[ $# < 1 ]]; then
echo "need project"
return
fi
gulp codegen --spec-root ~/code/azure-rest-api-specs/ --autorest-java ~/code/autorest.java/ --projects $@
}
gulpgenjpre() {
if [[ $# < 1 ]]; then
echo "need project"
return
fi
gulp codegen --spec-root ~/code/azure-rest-api-specs/ --autorest-java preview --autorest=2.0.4417 --projects $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment