Skip to content

Commit acdc7f1

Browse files
committed
update root.go
1 parent a764134 commit acdc7f1

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@
3131
- Move ICO specific conversion from PNG to ICO. PNG struct stick to spec.
3232
- v2.0.3
3333
- update go-helper/v2
34+
- v2.0.4
35+
- update go-helper/v2
36+
- update root.go

cmd/root.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@ var rootCmd = &cobra.Command{
6969

7070
},
7171
Run: func(cmd *cobra.Command, args []string) {
72-
var icoFile string
73-
if errs.IsEmpty() {
72+
var (
73+
ico *p2i.ICO
7474
icoFile = args[len(args)-1]
75-
}
76-
ico := new(p2i.ICO).New(icoFile)
75+
pngNum = len(args) - 1
76+
)
7777
if errs.IsEmpty() {
78-
// Add PNGs into ico struct
79-
pngc := len(args) - 1
80-
for i := range pngc {
78+
ico = new(p2i.ICO).New(icoFile)
79+
for i := range pngNum {
8180
if ico.Err != nil {
8281
break
8382
}
@@ -86,9 +85,6 @@ var rootCmd = &cobra.Command{
8685
ezlog.Log().N("Add").M(args[i]).Out()
8786
}
8887
}
89-
errs.Queue("", ico.Err)
90-
}
91-
if errs.IsEmpty() {
9288
ico.Write()
9389
errs.Queue("", ico.Err)
9490
}
@@ -98,7 +94,7 @@ var rootCmd = &cobra.Command{
9894
},
9995
PersistentPostRun: func(cmd *cobra.Command, args []string) {
10096
if errs.NotEmpty() {
101-
ezlog.Err().L().M(errs.Errs).Out()
97+
ezlog.Err().L().M(errs.Errs()).Out()
10298
cmd.Usage()
10399
}
104100
},

p2i/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ THE SOFTWARE.
2323
package p2i
2424

2525
const (
26-
Version = "v2.0.3"
26+
Version = "v2.0.4"
2727
)

0 commit comments

Comments
 (0)