-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading Username and Password from environment to enable scripting #40
base: main
Are you sure you want to change the base?
Conversation
if (!interactive) { | ||
string appleId = environment.get("APPLE_ID_USER"); | ||
string password = environment.get("APPLE_ID_PWD"); | ||
if(interactive && (appleId is null || password is null)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably do an interactive ||
here, as if the interactive switch is given it's probably to make the prompt appear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think &&
is the better choice, as we want the prompt only in interactive mode - if there is no interactive mode, don't prompt, but fail - otherwise you'd receive a prompt in an non-interactive session.
For my use case I want to use this in an autonomous scripting scenario - failing in case input is required is exactly what I want :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just interactive then?
Otherwise your code is well-made |
c544aab
to
77d51fc
Compare
Gives the option to specify
APPLE_ID_USER
andAPPLE_ID_PWD
in the environment, to run this script non-interactively.Fails if MFA is required non-interactively.
This is my first time touching D-lang - please let me know if this is not how it should be done :D