spf13 / cobra-cli

Cobra CLI tool to generate applications and commands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't touch my licence

jtagcat opened this issue · comments

It'd be neat if cobra didn't touch an already existing LICENCE file. I have to revert changes every time I use cobra.

Hi @jtagcat - thanks for opening an issue.

Can you provide a few commands and user flow to reproduce the issue? Thanks much!

$ go get -u github.com/spf13/cobra
$ go version
go version go1.17.5 linux/amd64
$ ls ~/.cobra.yaml
"/home/jc/.cobra.yaml": No such file or directory (os error 2)
$ cd $(mktemp -d)
$ go mod init x
go: creating new go.mod: module x
$ cp /f/git/jc/git-id/LICENSE .
$ head -n2 LICENSE
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007
$ cobra init
Your Cobra application is ready at
/tmp/tmp.m6R0lXbzOa
$ cat LICENSE # empty

Additionally, it'd be nice if I could opt-out of the in-each-file header, if that's ok.

Hmmm I see. So given an existing project with an existing licenses, you don't want cobra to overwrite the license. I think that seems reasonable and we can definitely do that with a flag.

And for opting out of the in-file headers, I think we could also have a flag that does that.

I would like to work on this issue. Can you please assign this to me?

The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied. - After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied and the issue is closed.
    You can:
  • Make a comment to remove the stale label and show your support. The 60 days reset. - If an issue has lifecycle/rotten and is closed, comment and ask maintainers if they'd be interseted in reopening

ah, the notification abuse bot has arrived!! /enthusiastic

The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied. - After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied and the issue is closed.
    You can:
  • Make a comment to remove the stale label and show your support. The 60 days reset. - If an issue has lifecycle/rotten and is closed, comment and ask maintainers if they'd be interseted in reopening

Hi all - I've transferred this issue here to spf13/cobra-cli since this is specifically about the bootstrapping tool that was moved out of the core spf13/cobra repository.

This is still relevant, so re-opening.

PR welcome!

Shouldn't the default behavior to warn user if an existing LICENSE file is detected? And suggest to explicitly use a flag to not replace the LICENSE? Otherwise continue replacing the file.

@laureanray The PR in place, lists down the current licenses and warns / reconfirms from the user before overwriting the license.

fmt.Print("LICENSE exists. Would you like to overwrite it? [Y/n] ")

Sorry didn't see the PR. Great job. Looking forward for it to be merged.

This issue is being marked as stale due to a long period of inactivity

This issue is being marked as stale due to a long period of inactivity

Hello 👋
My PR is ready for review #60.
Thanks

This issue is being marked as stale due to a long period of inactivity

This issue is being marked as stale due to a long period of inactivity

This PR is long-awaited to be merged. #4
Is any action required?

This license thing is so annoying. Please merge this PR already.