@@ -94,12 +94,12 @@ func Notice() error {
94
94
fmt .Println (">> Generating NOTICE" )
95
95
fmt .Println (">> fmt - go mod tidy" )
96
96
err := sh .RunV ("go" , "mod" , "tidy" , "-v" )
97
- if err != nil {
97
+ if err != nil {
98
98
return errors .Wrap (err , "failed running go mod tidy, please fix the issues reported" )
99
99
}
100
100
fmt .Println (">> fmt - go mod download" )
101
101
err = sh .RunV ("go" , "mod" , "download" )
102
- if err != nil {
102
+ if err != nil {
103
103
return errors .Wrap (err , "failed running go mod download, please fix the issues reported" )
104
104
}
105
105
fmt .Println (">> fmt - go list" )
@@ -108,8 +108,8 @@ func Notice() error {
108
108
return errors .Wrap (err , "failed running go list, please fix the issues reported" )
109
109
}
110
110
fmt .Println (">> fmt - go run" )
111
- cmd := exec .Command ("go" , "run" , "go.elastic.co/go-licence-detector" , "-includeIndirect" , "-rules" , "dev-tools/notice/rules.json" , "-overrides" , "dev-tools/notice/overrides.json" , "-noticeTemplate" , "dev-tools/notice/NOTICE.txt.tmpl" ,
112
- "-noticeOut" , "NOTICE.txt" , "-depsOut" ,"\" \" " )
111
+ cmd := exec .Command ("go" , "run" , "go.elastic.co/go-licence-detector" , "-includeIndirect" , "-rules" , "dev-tools/notice/rules.json" , "-overrides" , "dev-tools/notice/overrides.json" , "-noticeTemplate" , "dev-tools/notice/NOTICE.txt.tmpl" ,
112
+ "-noticeOut" , "NOTICE.txt" , "-depsOut" , "\" \" " )
113
113
stdin , err := cmd .StdinPipe ()
114
114
if err != nil {
115
115
return errors .Wrap (err , "failed running go run, please fix the issues reported" )
@@ -128,31 +128,29 @@ func Notice() error {
128
128
if err != nil {
129
129
return errors .Wrap (err , "failed combined output, please fix the issues reported" )
130
130
}
131
- return nil
131
+ return nil
132
132
}
133
133
134
-
135
134
func CheckNoChanges () error {
136
135
fmt .Println (">> fmt - go run" )
137
136
err := sh .RunV ("go" , "mod" , "tidy" , "-v" )
138
- if err != nil {
137
+ if err != nil {
139
138
return errors .Wrap (err , "failed running go mod tidy, please fix the issues reported" )
140
139
}
141
140
fmt .Println (">> fmt - git diff" )
142
141
err = sh .RunV ("git" , "diff" )
143
- if err != nil {
142
+ if err != nil {
144
143
return errors .Wrap (err , "failed running git diff, please fix the issues reported" )
145
144
}
146
145
fmt .Println (">> fmt - git update-index" )
147
146
err = sh .RunV ("git" , "update-index" , "--refresh" )
148
- if err != nil {
147
+ if err != nil {
149
148
return errors .Wrap (err , "failed running git update-index --refresh, please fix the issues reported" )
150
149
}
151
150
fmt .Println (">> fmt - git diff-index" )
152
151
err = sh .RunV ("git" , "diff-index" , "--exit-code" , "HEAD" , " --" )
153
- if err != nil {
152
+ if err != nil {
154
153
return errors .Wrap (err , "failed running go mod tidy, please fix the issues reported" )
155
154
}
156
155
return nil
157
156
}
158
-
0 commit comments