@@ -20,7 +20,7 @@ func UploadDirectoryToSpaces(config config.Config, bucket string, sourcePath str
2020 }
2121
2222 // Create a file where we will write the zipped archive
23- fmt .Printf ("Creating zipped archive at %s\n " , zipFilePath )
23+ fmt .Printf ("Creating zipped archive at %s\n " , zipFilePath )
2424 zipFile , err := os .Create (zipFilePath )
2525 if err != nil {
2626 return err
@@ -33,26 +33,26 @@ func UploadDirectoryToSpaces(config config.Config, bucket string, sourcePath str
3333
3434 // Walk the directory and recursively add files to the zipped archive
3535 err = filepath .Walk (sourcePath , func (path string , info os.FileInfo , err error ) error {
36- target := path
36+ target := path
3737 if err != nil {
3838 return err
3939 }
4040
41- // If it's a symbolic link, resolve the target
42- if info .Mode ()& os .ModeSymlink == os .ModeSymlink {
43- target , err := os .Readlink (path )
44- fmt .Printf ("Resolved link from %s to %s\n " , path , target )
45- if err != nil {
46- return err
47- }
48- }
41+ // If it's a symbolic link, resolve the target
42+ if info .Mode ()& os .ModeSymlink == os .ModeSymlink {
43+ target , err := os .Readlink (path )
44+ fmt .Printf ("Resolved link from %s to %s\n " , path , target )
45+ if err != nil {
46+ return err
47+ }
48+ }
4949
5050 // If this is a subdirectory, make sure the path ends with a trailing slash before we create it
5151 // See https://pkg.go.dev/archive/zip#Writer.Create for details
52- targetInfo , err := os .Stat (target )
53- if err != nil {
54- return err
55- }
52+ targetInfo , err := os .Stat (target )
53+ if err != nil {
54+ return err
55+ }
5656
5757 if targetInfo .IsDir () {
5858 cleanPath := filepath .Clean (path ) + string (filepath .Separator )
@@ -64,11 +64,10 @@ func UploadDirectoryToSpaces(config config.Config, bucket string, sourcePath str
6464 return nil
6565 }
6666
67-
68- // Don't recursively add this zipped archive
69- if filepath .Base (path ) == zipFileName {
70- return nil
71- }
67+ // Don't recursively add this zipped archive
68+ if filepath .Base (path ) == zipFileName {
69+ return nil
70+ }
7271
7372 fmt .Printf ("Adding %s to the zipped archive\n " , target )
7473
0 commit comments