@@ -3,7 +3,6 @@ package sync
33import (
44 "archive/tar"
55 "compress/gzip"
6- "github.com/loft-sh/devspace/pkg/util/command"
76 "github.com/loft-sh/devspace/pkg/util/fsutil"
87 "io"
98 "io/ioutil"
@@ -154,23 +153,6 @@ func (u *Unarchiver) untarNext(destPath string, tarReader *tar.Reader) (bool, er
154153 // Set mod time correctly
155154 _ = os .Chtimes (outFileName , time .Now (), header .ModTime )
156155
157- // Execute command if defined
158- if u .syncConfig .Options .FileChangeCmd != "" {
159- cmdArgs := make ([]string , 0 , len (u .syncConfig .Options .FileChangeArgs ))
160- for _ , arg := range u .syncConfig .Options .FileChangeArgs {
161- if arg == "{}" {
162- cmdArgs = append (cmdArgs , outFileName )
163- } else {
164- cmdArgs = append (cmdArgs , arg )
165- }
166- }
167-
168- out , err := command .CombinedOutput (u .syncConfig .ctx , u .syncConfig .LocalPath , u .syncConfig .Options .FileChangeCmd , cmdArgs ... )
169- if err != nil {
170- return false , errors .Errorf ("Error executing command '%s %s': %s => %v" , u .syncConfig .Options .FileChangeCmd , strings .Join (cmdArgs , " " ), string (out ), err )
171- }
172- }
173-
174156 // Update fileMap so that upstream does not upload the file
175157 u .syncConfig .fileIndex .fileMap [relativePath ] = & FileInformation {
176158 Name : relativePath ,
@@ -201,22 +183,6 @@ func (u *Unarchiver) createAllFolders(name string, perm os.FileMode) error {
201183
202184 return errors .Errorf ("Error creating %s: %v" , dirToCreate , err )
203185 }
204-
205- if u .syncConfig .Options .DirCreateCmd != "" {
206- cmdArgs := make ([]string , 0 , len (u .syncConfig .Options .DirCreateArgs ))
207- for _ , arg := range u .syncConfig .Options .DirCreateArgs {
208- if arg == "{}" {
209- cmdArgs = append (cmdArgs , dirToCreate )
210- } else {
211- cmdArgs = append (cmdArgs , arg )
212- }
213- }
214-
215- out , err := command .CombinedOutput (u .syncConfig .ctx , u .syncConfig .LocalPath , u .syncConfig .Options .DirCreateCmd , cmdArgs ... )
216- if err != nil {
217- return errors .Errorf ("Error executing command '%s %s': %s => %v" , u .syncConfig .Options .DirCreateCmd , strings .Join (cmdArgs , " " ), string (out ), err )
218- }
219- }
220186 }
221187
222188 return nil
0 commit comments