-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfixes: low hanging fruit #55
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import ( | |
) | ||
|
||
func CleanJob(config config.Config, existingState *state.State, jobID int64, force bool) error { | ||
prefix := fmt.Sprintf("job-%v", jobID) | ||
prefix := fmt.Sprintf("job-%v/", jobID) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change from - prefix := fmt.Sprintf("job-%v", jobID)
+ prefix := fmt.Sprintf("job-%v/", jobID) Please ensure that this change aligns with the intended functionality. |
||
objects, err := s3.ListObjects(config, prefix) | ||
if err != nil { | ||
return fmt.Errorf("Failed to list objects in bucket with prefix %s: %w", prefix, err) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,10 @@ import ( | |
) | ||
|
||
var ( | ||
Version = "dev" | ||
Commit = "none" | ||
Date = "unknown" | ||
ConfigFilePath = fmt.Sprintf("%s/.config/cloudexec/config.toml", os.Getenv("HOME")) | ||
LaunchConfigFilePath = "./cloudexec.toml" | ||
Version = "dev" | ||
Commit = "none" | ||
Date = "unknown" | ||
ConfigFilePath = fmt.Sprintf("%s/.config/cloudexec/config.toml", os.Getenv("HOME")) | ||
Comment on lines
+17
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of - ConfigFilePath = fmt.Sprintf("%s/.config/cloudexec/config.toml", os.Getenv("HOME"))
+ homeDir, _ := os.UserHomeDir()
+ ConfigFilePath = fmt.Sprintf("%s/.config/cloudexec/config.toml", homeDir) |
||
) | ||
|
||
func main() { | ||
|
@@ -90,6 +89,7 @@ func main() { | |
Flags: []cli.Flag{ | ||
&cli.StringFlag{ | ||
Name: "config", | ||
Value: "./cloudexec.toml", // default config filepath | ||
Usage: "cloudexec.toml file path", | ||
}, | ||
&cli.StringFlag{ | ||
|
@@ -109,15 +109,16 @@ func main() { | |
return configErr | ||
} | ||
// Check if a local cloudexec.toml exists | ||
if _, err := os.Stat(LaunchConfigFilePath); os.IsNotExist(err) { | ||
launchConfigFilePath := c.String("config") | ||
if _, err := os.Stat(launchConfigFilePath); os.IsNotExist(err) { | ||
// Check if the path to a launch config is provided | ||
if c.Args().Len() < 1 { | ||
return fmt.Errorf("please provide a path to a cloudexec.toml file or create one in the current directory") | ||
return fmt.Errorf("please create cloudexec.toml with 'cloudexec init' or use the '--config' flag to provide a path to your custom launch config file") | ||
} | ||
LaunchConfigFilePath = c.Args().Get(0) | ||
launchConfigFilePath = c.String("config") | ||
} | ||
// Load the launch configuration | ||
lc, err := LoadLaunchConfig(LaunchConfigFilePath) | ||
lc, err := LoadLaunchConfig(launchConfigFilePath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The This change switches to using the |
||
if err != nil { | ||
return err | ||
} | ||
|
@@ -129,7 +130,7 @@ func main() { | |
return err | ||
} | ||
err = Launch(config, dropletSize, dropletRegion, lc) | ||
return err | ||
return err | ||
}, | ||
}, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ fmt: | |
go fmt pkg/ssh/*.go | ||
go fmt pkg/state/*.go | ||
|
||
trunk: | ||
trunk: fmt | ||
trunk fmt | ||
trunk check | ||
Comment on lines
+8
to
10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change made to the - trunk: fmt
+ trunk-fmt: This way, the original |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ const ( | |
ColorGreen = "\033[32m" | ||
ColorBlue = "\033[34m" | ||
ColorYellow = "\033[33m" | ||
ColorWhite = "\033[37m" | ||
ColorWhite = "\033[97m" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change from "\033[37m" to "\033[97m" for - ColorWhite = "\033[97m"
+ ColorWhite = "\033[37m" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the color control code for "bright white" which looks an awful lot like default white tbh, either way: it's brighter and easier to read than the gray. |
||
) | ||
|
||
func Info(msg string, args ...interface{}) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a
/
to the end of the deletion prefix so that deletingjob-1
doesn't also delete fromjob-10
, etc