@@ -100,7 +100,11 @@ func (j *JFrogPublishCmd) Execute(args []string) error {
100100 }()
101101
102102 log .Println ("publishing modules" )
103- filepath .Walk (workDir , func (path string , info os.FileInfo , err error ) error {
103+ err := filepath .Walk (workDir , func (path string , info os.FileInfo , err error ) error {
104+ if err != nil {
105+ return err
106+ }
107+
104108 if strings .HasPrefix (info .Name (), "cache" ) {
105109 return filepath .SkipDir
106110 }
@@ -116,7 +120,7 @@ func (j *JFrogPublishCmd) Execute(args []string) error {
116120 <- doneCh
117121
118122 log .Println ("modules successfully uploaded" )
119- return nil
123+ return err
120124}
121125
122126func (j JFrogPublishCmd ) getJFrogCfg () (config []string ) {
@@ -171,6 +175,10 @@ func (f FolderPublishCmd) Execute(args []string) error {
171175 dirPrefix := filepath .Join (workDir , "cache" , "download" )
172176 var wg sync.WaitGroup
173177 err = filepath .Walk (dirPrefix , func (path string , info os.FileInfo , err error ) error {
178+ if err != nil {
179+ return err
180+ }
181+
174182 relPath := strings .TrimLeft (strings .TrimPrefix (path , dirPrefix ), string (filepath .Separator ))
175183
176184 if strings .HasPrefix (relPath , "sumdb" ) && ! info .IsDir () {
@@ -194,10 +202,11 @@ func (f FolderPublishCmd) Execute(args []string) error {
194202 return nil
195203 })
196204
205+ wg .Wait ()
206+
197207 if err != nil {
198- log . Println ( errorRedPrefix , err )
208+ return err
199209 }
200- wg .Wait ()
201210
202211 ppath , _ := filepath .Abs (f .Output )
203212 log .Println ("published archive to:" , color .GreenString (ppath ))
0 commit comments