aboutsummaryrefslogtreecommitdiffstats
path: root/update-license.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-01-07 20:17:50 +0800
committerFelix Lange <fjl@twurst.com>2015-01-07 20:17:50 +0800
commit1d05027ba2637b4140f9056385214258b627761d (patch)
tree9a4ecd8dfe0708c21dd85d6110ee9a3656264142 /update-license.go
parentec7cb9981cdedabf0c18c2fdc51cc20941dcb1fa (diff)
downloaddexon-1d05027ba2637b4140f9056385214258b627761d.tar
dexon-1d05027ba2637b4140f9056385214258b627761d.tar.gz
dexon-1d05027ba2637b4140f9056385214258b627761d.tar.bz2
dexon-1d05027ba2637b4140f9056385214258b627761d.tar.lz
dexon-1d05027ba2637b4140f9056385214258b627761d.tar.xz
dexon-1d05027ba2637b4140f9056385214258b627761d.tar.zst
dexon-1d05027ba2637b4140f9056385214258b627761d.zip
a few fixes for the license tool
Diffstat (limited to 'update-license.go')
-rw-r--r--update-license.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/update-license.go b/update-license.go
index ab76e0f31..d5e21fdd3 100644
--- a/update-license.go
+++ b/update-license.go
@@ -1,11 +1,10 @@
// +build none
-
/*
This command generates GPL license headers on top of all source files.
You can run it once per month, before cutting a release or just
whenever you feel like it.
- go run update-licenses.go
+ go run update-license.go
The copyright in each file is assigned to any authors for which git
can find commits in the file's history. It will try to follow renames
@@ -199,12 +198,13 @@ func fileInfo(file string) (*info, error) {
return info, err
}
-func writeLicenses(infos <-chan *info) error {
+func writeLicenses(infos <-chan *info) {
buf := new(bytes.Buffer)
for info := range infos {
content, err := ioutil.ReadFile(info.file)
if err != nil {
fmt.Printf("ERROR: couldn't read %s: %v\n", info.file, err)
+ continue
}
// construct new file content
@@ -219,11 +219,10 @@ func writeLicenses(infos <-chan *info) error {
if !bytes.Equal(content, buf.Bytes()) {
fmt.Println("writing", info.ShortLicense(), info.file)
if err := ioutil.WriteFile(info.file, buf.Bytes(), info.mode); err != nil {
- return err
+ fmt.Printf("ERROR: couldn't write %s: %v", info.file, err)
}
}
}
- return nil
}
func doLines(cmd *exec.Cmd, f func(string)) error {