Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

matro
Copy link
Contributor

@matro matro commented Dec 11, 2015

This implements [<options>] [<directory> [<branch> [<repository]]] but requires all <options> come before the positional args.

Fixes part of #14.

This implements '[<options>] [<directory> [<branch> [<repository]]]'
but requires all <options> come before the positional args.
@matro
Copy link
Contributor Author

matro commented Dec 11, 2015

This feel a little hacky to me, but it seems to work in my testing.

@matro matro mentioned this pull request Dec 12, 2015
@X1011
Copy link
Owner

X1011 commented Dec 14, 2015

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.

@matro
Copy link
Contributor Author

matro commented Dec 16, 2015

Got some tests committed here, though I'm still working on the positional args themselves.

matro referenced this pull request in matro/git-directory-deploy Dec 16, 2015
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.
@matro
Copy link
Contributor Author

matro commented Dec 18, 2015

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"
Copy link
Owner

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.

Copy link
Owner

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?

Copy link
Contributor Author

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.

Matt Pearson added 4 commits December 18, 2015 07:33
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.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants