-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add positional args for directory, branch, and repository. #20
base: master
Are you sure you want to change the base?
Conversation
This implements '[<options>] [<directory> [<branch> [<repository]]]' but requires all <options> come before the positional args.
This feel a little hacky to me, but it seems to work in my testing. |
as with #19, i'm going to wait until we have tests for order of preference to merge this, cause i think the env variables will override these arguments as it is currently implemented. |
Got some tests committed here, though I'm still working on the positional args themselves. |
This should allow a config. file specified on the command-line to overwrite values set in '.env', which in turn ovewrite values set in the environment. Values set for these same vars in the args- parsing loop should then overwrite all of the above. Anything left unset by environment vars above are then covered when the "internal" vars are populated by the `var=${ENV_VAR:-default}` lines.
720240f
to
f6036b5
Compare
I've merged master into this, and added a couple more commits. I think this is working now. All tests pass (including one specifically for the positional args), and there're docs for this. |
At the end of the command, you can optionally specify the directory, branch, | ||
and repository as well. Earlier values are required to specify later ones. For | ||
example, in order to specify <branch>, you must also specify <directory>. Like | ||
the command-line options, these" |
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.
looks like this is unfinished.
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.
@matro so what was supposed to come after this?
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.
Last minute coding before travel while tired didn't serve me here. b91b54e completes that sentence.
Without this, the script continues to execute, and we see this error: ``` ./deploy.sh: line 124: [: =: unary operator expected Deploy directory '' does not exist. Aborting. ```
This implements
[<options>] [<directory> [<branch> [<repository]]]
but requires all<options>
come before the positional args.Fixes part of #14.