Skip to content

Commit

Permalink
Merge pull request #89 from pwittrock/master
Browse files Browse the repository at this point in the history
Minor fixes: fail if copyright is missing.  Update refernce-docs vendor.
  • Loading branch information
Phillip Wittrock authored Jun 27, 2017
2 parents 5e9d0bc + fb421dc commit 981e531
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 42 deletions.
29 changes: 5 additions & 24 deletions cmd/apiserver-boot/boot/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,13 @@ func WriteIfNotFound(path, templateName, templateValue string, data interface{})

func GetCopyright(file string) string {
if len(file) == 0 {
// default to boilerplate.go.txt
if _, err := os.Stat("boilerplate.go.txt"); err == nil {
// Set this because it is passed to generators
file = "boilerplate.go.txt"
cr, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalf("could not read Copyright file %s", file)
}
return string(cr)
}

log.Fatalf("apiserver-boot create-resource requires the --copyright flag if boilerplate.go.txt does not exist")
file = "boilerplate.go.txt"
}

if _, err := os.Stat(file); err != nil {
if !os.IsNotExist(err) {
log.Fatalf("Could not stat %s: %v", file, err)
}
return ""
} else {
cr, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalf("could not read Copyright file %s", file)
}
return string(cr)
cr, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalf("Must create boilerplate.go.txt file with copyright and file headers")
}
return string(cr)
}

func GetDomain() string {
Expand Down
Empty file added docs/creating_docs.md
Empty file.
6 changes: 3 additions & 3 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ import:
subpackages:
- cmd/libs/go2idl
- package: github.com/kubernetes-incubator/reference-docs
version: 2dfbd12487e43ebd2c7ceb045a0be97a7e11208e
version: 96204a551e6fceeed37f844f8598ad1cb60d7eed
subpackages:
- gen-apidocs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 981e531

Please sign in to comment.