@@ -141,22 +141,32 @@ func (s SDK) unpackDispatcher() error {
141141 }
142142 log .Infof ("unpacking SDK dispatcher tools ZIP '%s' to dir '%s'" , zip , s .DispatcherDir ())
143143 err = filex .Unarchive (zip , s .DispatcherDir ())
144- log .Infof ("unpacked SDK dispatcher tools ZIP '%s' to dir '%s'" , zip , s .DispatcherDir ())
145144 if err != nil {
146145 return err
147146 }
147+ log .Infof ("unpacked SDK dispatcher tools ZIP '%s' to dir '%s'" , zip , s .DispatcherDir ())
148148 } else {
149149 script , err := s .dispatcherToolsUnixScript ()
150150 if err != nil {
151151 return err
152152 }
153- log .Infof ("unpacking SDK dispatcher tools using script '%s' to dir '%s'" , script , s .DispatcherDir ())
154- cmd := execx .CommandShell ([]string {script , "--target" , s .DispatcherDir ()})
155- s .vendorManager .aem .CommandOutput (cmd )
156- if err := cmd .Run (); err != nil {
157- return fmt .Errorf ("cannot run SDK dispatcher tools unpacking script '%s': %w" , script , err )
153+
154+ // On Windows host, we cannot execute .sh script, so extract archive manually
155+ if osx .IsWindows () {
156+ log .Infof ("extracting SDK dispatcher tools from Makeself script '%s' to dir '%s'" , script , s .DispatcherDir ())
157+ if err := filex .UnarchiveMakeself (script , s .DispatcherDir ()); err != nil {
158+ return fmt .Errorf ("cannot extract SDK dispatcher tools from Makeself script '%s': %w" , script , err )
159+ }
160+ log .Infof ("extracted SDK dispatcher tools from Makeself script '%s' to dir '%s'" , script , s .DispatcherDir ())
161+ } else {
162+ log .Infof ("unpacking SDK dispatcher tools using script '%s' to dir '%s'" , script , s .DispatcherDir ())
163+ cmd := execx .CommandShell ([]string {script , "--target" , s .DispatcherDir ()})
164+ s .vendorManager .aem .CommandOutput (cmd )
165+ if err := cmd .Run (); err != nil {
166+ return fmt .Errorf ("cannot run SDK dispatcher tools unpacking script '%s': %w" , script , err )
167+ }
168+ log .Infof ("unpacked SDK dispatcher tools using script '%s' to dir '%s'" , script , s .DispatcherDir ())
158169 }
159- log .Infof ("unpacked SDK dispatcher tools using script '%s' to dir '%s'" , script , s .DispatcherDir ())
160170 }
161171 return nil
162172}
0 commit comments