-
Notifications
You must be signed in to change notification settings - Fork 252
Adding config for custom domains/prefixes and properly strip custom ports. #92
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
Conversation
@ffes can you take a look at the above to see if it works for you? |
What about remotes without username/host. I can have the remote github:paulirish/git-open |
git-open
Outdated
|
||
function replaceConfig() { | ||
config=$(git config --get-urlmatch "open.$1" "$openurl") | ||
declare -g -- "$1"="${config:-${!1}}" |
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.
On the stock Bash v3.2.57 that comes with macOS, the -g
flag causes the following error:
../git-open: line 63: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
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.
Weird it seems to work for me on the same version. Do you mind testing without the -g
? Don't think it's needed here anyway
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.
Nevermind, I duplicated it. I'll fix it
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.
Yes, it works fine for me without the -g
option.
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 the variable will just be in localscope sadly, it won't error but the custom var won't work
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.
Just pushed a fix up (I just echoed the variable and set it on the return)
…ins and protocols.
@nwinkler ping when you have some time! |
let's do it. |
noticed we still need readme updates. I'll put those up for review. |
…ins and protocols. (paulirish#92)
This combined all of the config into 2 items - protocol and server. They use git-config's url option to match the url. Also went back to clean up exactly how the url and server was stripped in order to fix ports.
Should fix #87. Still needs readme updates, but wanted thoughts on it