Closed zevaverbach closed 4 years ago
Hmm aren't we already doing that? https://github.com/node-gh/gh/blob/master/src/cmds/repo.ts#L541
I'm afraid not! Just upgraded to 2.1.0 and did gh repo --new --type private
. It created this repo, which is called --type
and is public.
Does this work for you? gh re --new foo --init --type private
The --init
isn't required, and yes, that does work, but it doesn't resolve this issue (naming the repo according to the root dir name).
I see. So it sounds like we are forcing whatever comes after --new
to be the repo name. What you want to do makes sense then.
Go for it and please let me know how I can help 👍
👍 Will do. Any thoughts on doing #696 simultaneously?
I'm fine with it being one PR unless you prefer to do it in 2 :)
@protoEvangelion changed your mind about this or...?
Sorry about that...this is getting auto closed by some script I have 😑
Occupational hazard of testing this repo since it hits real apis 😬
@zevaverbach I've been thinking about this some more and it seems to be fundamentally a parser issue.
Our parser (nopt) isn't "smart" in that if you pass two flags one right after the other --foo --bar
the parsed options will be { foo: '--bar'}
.
I've been wanting to change option parsers for a while now, but you may to get around this by checking if the value in new
is a known flag. If it is, we can fallback to the local dir's name.
Doing some further research, it looks like nopt resolved this exact issue in it's latest version v4:
The version we are using:
Updating, could be the proper resolution to this ;)
@zevaverbach did you have something in the works already?
Not yet, sorry!
On Wed, Nov 6, 2019 at 5:44 PM Ryan Garant notifications@github.com wrote:
@zevaverbach https://github.com/zevaverbach did you have something in the works already?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/issues/695?email_source=notifications&email_token=AAVVCNEXNE4U7DFYZKTW5LDQSLX75A5CNFSM4I5MAFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDHGERY#issuecomment-550396487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVVCNBEZ6ZLLQMIFEFUBFLQSLX75ANCNFSM4I5MAFQQ .
That's OK. I will update nopt to see if that fixes the issue 👍
:tada: This issue has been resolved in version 2.6.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Describe the solution you'd like
repo --new --type private
, for example, when executed in a local repo calledrepo
, would create a new private repo with the namerepo
.Would render #694 moot.
Would you accept a PR implementing this?