cobra-cli icon indicating copy to clipboard operation
cobra-cli copied to clipboard

Don't touch my licence

Open jtagcat opened this issue 2 years ago • 19 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.

jtagcat avatar Feb 07 '22 14:02 jtagcat

Hi @jtagcat - thanks for opening an issue.

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

jpmcb avatar Feb 08 '22 18:02 jpmcb

$ 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

jtagcat avatar Feb 11 '22 16:02 jtagcat

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

jtagcat avatar Feb 11 '22 16:02 jtagcat

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.

jpmcb avatar Feb 11 '22 21:02 jpmcb

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

harjyotbagga avatar Feb 18 '22 21:02 harjyotbagga

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

github-actions[bot] avatar Apr 25 '22 00:04 github-actions[bot]

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

jtagcat avatar Apr 25 '22 15:04 jtagcat

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

github-actions[bot] avatar Jun 26 '22 00:06 github-actions[bot]

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!

jpmcb avatar Jul 27 '22 20:07 jpmcb

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 avatar Aug 09 '22 08:08 laureanray

@laureanray The PR in place, lists down the current licenses and warns / reconfirms from the user before overwriting the license. https://github.com/spf13/cobra-cli/blob/6ed77f4e42e5ff07a6c7741a8902c3baf4ed74de/cmd/project.go#L116

harjyotbagga avatar Aug 09 '22 10:08 harjyotbagga

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

laureanray avatar Aug 09 '22 14:08 laureanray

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

github-actions[bot] avatar Oct 09 '22 00:10 github-actions[bot]

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

github-actions[bot] avatar Dec 10 '22 00:12 github-actions[bot]

Hello 👋 My PR is ready for review https://github.com/spf13/cobra-cli/pull/60. Thanks

andreaangiolillo avatar Dec 21 '22 23:12 andreaangiolillo

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

github-actions[bot] avatar Feb 20 '23 00:02 github-actions[bot]

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

github-actions[bot] avatar Apr 23 '23 00:04 github-actions[bot]

This PR is long-awaited to be merged. https://github.com/spf13/cobra-cli/pull/4 Is any action required?

harjyotbagga avatar Apr 26 '23 12:04 harjyotbagga