Skip to content
Myr

Parse the full license text as a template

Before adoption: this commit came in with the history the project adopted, so no landing records it.

... to allow including "Copyright © 2015 NAME HERE" to the output LICENSE file where necessary

authored by Anthony Fok · committed by Anthony Fok · parent 10546a0 · Browse files · 1 file+11 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−1 removed

  • other:+11 added−1 removed

1 file+11 added−1 removed

modified:cobra/cmd/init.go+11 added-1 removed
14 unmodified lines
1516import (17 "fmt"18 "os"19 "strings"2021 "github.com/spf13/cobra"22 "github.com/spf13/viper"23)
63 unmodified lines
87}8889func createLicenseFile() {90 lic := getLicense()90 err := writeStringToFile(ProjectPath(), "LICENSE", lic.Text)9192 template := lic.Text9394 var data map[string]interface{}95 data = make(map[string]interface{})9697 // Try to remove the email address, if any98 data["copyright"] = strings.Split(copyrightLine(), " <")[0]99100 err := writeTemplateToFile(ProjectPath(), "LICENSE", template, data)101 _ = err102 // if err != nil {103 // er(err)104 // }
122 unmodified lines