Steve Francia
26825627c2
Simplifying goGet function
2021-11-03 15:36:51 -04:00
Steve Francia
9388e79fb4
Cobra generator now works within Go modules
...
Pretty major change in behavior, but with modules a change is needed.
Now cobra can initialize and add from within any Go module.
The experience is simplified and streamlined, but requires `go mod init` to happen first.
2021-11-03 15:36:51 -04:00
Unai Martinez-Corral
652c755d37
Use golangci-lint ( #1044 )
...
Use golangci-lint. Repair warnings and errors resulting from linting.
2021-02-07 17:08:50 -07:00
Warren Fernandes
41fd44e1df
Fix cobra init cmd help documentation ( #1108 )
...
Adds tests for other cases where we do not expect projects to be created
for absolute paths and relative paths in GOPATH.
2020-04-28 16:59:18 -06:00
Amit Botzer
8c638d3f90
Fixed typo. ( #1087 )
...
Changed 'applicaton' to 'application'.
2020-04-10 15:30:10 -06:00
Bruce Downs
d85196337c
Correct all complaints from goimports
...
* i.e.
* go get golang.org/x/tools/cmd/goimports
* goimports -w *.go
* goimports -w cobra/
2019-08-02 01:25:21 +05:00
jharshman
e993d53002
vgo - take named directory or current wd
2019-06-07 10:31:03 -04:00
jharshman
04af6aed80
vgo - add todo
2019-06-07 10:31:03 -04:00
jharshman
c3b51f3a2e
simplify test
2019-06-07 10:31:03 -04:00
jharshman
4c22a20fd4
vgo - remove unused methods
2019-06-07 10:31:03 -04:00
jharshman
abab9aa52a
vgo - add Create method to Project struct
2019-06-07 10:31:03 -04:00
jharshman
69420a9ffa
vgo - create directory
2019-06-07 10:31:03 -04:00
jharshman
17dc9f8142
fixing up templates more
2019-06-07 10:31:03 -04:00
jharshman
26d210e2cd
vgo - fixing up the root template
2019-06-07 10:31:03 -04:00
jharshman
80ea2901b6
vgo-support - re-working code generator
2019-06-07 10:31:03 -04:00
Rajat Jindal
615425954c
remove dot after the abs path ( #672 )
2018-04-12 08:08:29 -04:00
Patrick Uiterwijk
b95ab734e2
Remove trailing whitespace in rootcmd ( #606 )
...
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2017-12-31 15:15:56 +05:00
Nick Miyake
1be1d2841c
Make rootCmd private
...
Update Cobra generator to make rootCmd private rather than
exporting it. Also update examples in README to use the exported
Execute() command rather than referencing unexported rootCmd.
Fixes #556
2017-11-23 08:13:30 +01:00
Anthony Fok
9e024b655b
cmd: Refine formatting of included licenses
2017-07-30 02:35:06 -06:00
Anthony Fok
a1b7d3cc4d
cmd: Add a blank line between copyright and license
2017-07-30 02:15:55 -06:00
Johanan Liebermann
31694f19ad
Add missing 'and' in comment
2017-06-21 19:32:59 +02:00
Albert Nigmatzianov
b4dbd37a01
cmd: Fix tests
2017-06-12 08:36:10 +02:00
Albert Nigmatzianov
defa97f560
cmd: Fix output root.go of init with --viper=false
...
Fix #462
2017-06-12 08:23:33 +02:00
Behrang Noruzi Niya
a28055bed2
cmd: Fix minor bugs in init command ( #446 )
2017-05-14 12:00:53 +02:00
Albert Nigmatzianov
db6b9a8b3f
cmd: Fix incorrect initialzation by cobra init .
...
Close #314
2017-05-05 10:51:57 +02:00
Albert Nigmatzianov
d20925b932
cmd: Small correctives
2017-05-05 10:35:27 +02:00
Albert Nigmatzianov
84cba621a0
cmd: Make detection of $HOME work on all systems
...
Use github.com/mitchellh/go-homedir
Fix #430
2017-05-05 10:35:27 +02:00
Albert Nigmatzianov
0dd1c429a3
cmd: Add more docs
2017-05-05 10:35:27 +02:00
Albert Nigmatzianov
32756eb440
cmd: Rewrite
2017-05-05 10:35:27 +02:00
Elliot Morrison-Reed
a3cd8ab85a
Use os.Getenv("HOME") instead of "$HOME" for windows compatibility ( #337 )
2017-04-20 15:35:06 +02:00
Ian Walter
9a8186dbb5
Improving createLicenseFile function
...
Also fixing typo in README example.
2016-04-27 12:03:26 -04:00
Ian Walter
d811f40c6a
Adding custom license functionality
...
* Refactoring code that unnecessarily declares a map before making it.
* Cleaning up gpl3 formatting to match other licenses.
* Adding functionality that allows specifying custom license header
and text in cobra config.
* Using license header and text as templates so that they can use
template variables (for custom and gpl3 licenses).
* Adding ability to specify no license.
* Adding custom license example to README.
2016-04-27 12:03:26 -04:00
Kevin Kirsche
3e71c61197
Update init per golint
...
X-Ref: #258
2016-04-01 21:29:12 -04:00
Anthony Fok
c65e6422ff
Fix typo: exiting → existing
2015-12-17 14:43:23 -07:00
Anthony Fok
c3ef89ad8a
Fix typo: initalize → initialize, etc.
...
Detected by Debian’s Lintian tool
2015-12-17 11:18:55 -07:00
Anthony Fok
6d6c92d5b7
Parse the full license text as a template
...
... to allow including "Copyright © 2015 NAME HERE" to the output
LICENSE file where necessary
2015-11-21 23:29:20 -07:00
Anthony Fok
0cc7cc2c06
Fix typo in cobra/cmd/init.go
2015-11-20 15:50:06 -07:00
Anthony Fok
1e63ad8ed1
Fine-tune the formatting of Cobra’s generated code
2015-11-20 15:28:40 -07:00
spf13
8377361429
Add extra feedback on successful initialization
2015-10-28 13:45:33 -04:00
spf13
ea5bc31ac4
Add cobra generator application
2015-10-28 12:51:48 -04:00