Skip to content

Commit 43eb0fd

Browse files
committed
reformat
1 parent d019721 commit 43eb0fd

File tree

2 files changed

+29
-30
lines changed

2 files changed

+29
-30
lines changed

cmd/cloudexec/main.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ func main() {
7575
return nil
7676
},
7777
},
78-
{
79-
Name: "init",
80-
Usage: "Create a new cloudexec.toml launch configuration in the current directory",
81-
Action: func(c *cli.Context) error {
82-
err := InitLaunchConfig()
83-
if err != nil {
84-
return err
85-
}
86-
return nil
87-
},
88-
},
78+
{
79+
Name: "init",
80+
Usage: "Create a new cloudexec.toml launch configuration in the current directory",
81+
Action: func(c *cli.Context) error {
82+
err := InitLaunchConfig()
83+
if err != nil {
84+
return err
85+
}
86+
return nil
87+
},
88+
},
8989
{
9090
Name: "launch",
9191
Usage: "Launch a droplet and start a job",

cmd/cloudexec/push.go

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)