Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Fallback to environment if values not specified for AppleId #10

Merged
merged 1 commit into from
Nov 11, 2019
Merged

Fallback to environment if values not specified for AppleId #10

merged 1 commit into from
Nov 11, 2019

Conversation

maxfierke
Copy link
Contributor

If any values are not specified in the config file for AppleId
we can fallback to pulling them from AC_USERNAME, AC_PASSWORD,
and AC_PROVIDER.

AC_PASSWORD will still be passed into altool using the @env:
prefix as supported by altool to avoid printing sensitive
information but all others will be read from the environment and
passed by value to altool.

Resolves #9

If any values are not specified in the config file for `AppleId`
we can fallback to pulling them from `AC_USERNAME`, `AC_PASSWORD`,
and `AC_PROVIDER`.

`AC_PASSWORD` will still be passed into `altool` using the `@env:`
prefix as supported by `altool` to avoid printing sensitive
information but all others will be read from the environment and
passed by value to `altool`.
Copy link
Owner

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really great. Thanks.

I'm going to make one small nitpick after merge, I noted it in the inline comments.

if cfg.AppleId.Username == "" {
appleIdUsername, ok := os.LookupEnv("AC_USERNAME")

if ok {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but I prefer to do a !ok check and exit, so that we don't need a full else case.

@mitchellh mitchellh merged commit 3278d62 into mitchellh:master Nov 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support reading Apple ID username/email from environment
2 participants