Skip to content

Commit 80f206c

Browse files
committed
update-generator-docs - update to reflect changes
Update Generator Docs to reflect changes brought in #817
1 parent 21f39ca commit 80f206c

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

cobra/README.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,24 @@ for you. It is a very powerful application that will populate your program with
1616
the right structure so you can immediately enjoy all the benefits of Cobra. It
1717
will also automatically apply the license you specify to your application.
1818

19-
Cobra init is pretty smart. You can provide it a full path, or simply a path
20-
similar to what is expected in the import.
19+
Cobra init is pretty smart. You can either run it in your current application directory
20+
or you can specify a path to an existing project. If the directory you point it at does not
21+
exist, it will be created for you.
22+
23+
Updates to the Cobra generator have now decoupled it from the GOPATH.
24+
As such `--pkg-name` is required.
25+
26+
> Note: init will no longer fail on non-empty directories.
27+
28+
```
29+
mkdir -p newApp && cd newApp
30+
cobra init --pkg-name github.com/spf13/newApp
31+
```
32+
33+
or
2134

2235
```
23-
cobra init github.com/spf13/newApp
36+
cobra init --pkg-name github.com/spf13/newApp path/to/newApp
2437
```
2538

2639
### cobra add

0 commit comments

Comments
 (0)