You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't want to create the .config/godaddy/credentials.json under the user's HOME directory, so I created it elsewhere and then in a subshell expected the change to HOME would be respected. Unfortunately, it didn't work. Looking at https://github.com/cabemo/godaddy-cli/blob/main/internal/config/config.go, I can see that it is actually getting the user.Current().HomeDir; not specifically the HOME environment variable. So even if the HOME environment variable changes, the program doesn't care. Here is a quick BASH script to illustrate the problem:
# Assume that HOME is initially /root
# Assume that the godaddy executable is in the working directory and is executable
# Assume that GODADDY_API_KEY contains a valid GoDaddy API key
# Assume that GODADDY_API_SECRET contains a valid GoDaddy API secret
mkdir -p /tmp/.config/godaddy
jq -n '$ARGS.named' \
--arg key "${GODADDY_API_KEY}" \
--arg secret "${GODADDY_API_SECRET}" > /tmp/.config/godaddy/credentials.json
# Assume that the domain acme.com is manageable by the GoDaddy account associated with the previously-set credentials
# I expect the following to work, but it fails to read credentials.json
(export HOME=/tmp ; ./godaddy records list --domain acme.com)
The text was updated successfully, but these errors were encountered:
I don't want to create the .config/godaddy/credentials.json under the user's HOME directory, so I created it elsewhere and then in a subshell expected the change to HOME would be respected. Unfortunately, it didn't work. Looking at https://github.com/cabemo/godaddy-cli/blob/main/internal/config/config.go, I can see that it is actually getting the user.Current().HomeDir; not specifically the HOME environment variable. So even if the HOME environment variable changes, the program doesn't care. Here is a quick BASH script to illustrate the problem:
The text was updated successfully, but these errors were encountered: