add app state, and fix a few bugs
This commit is contained in:
@@ -14,9 +14,12 @@ func StartCommand(ctx CommandCtx, args []string) error {
|
||||
|
||||
// Put request to start the project, since the start endpoint is idempotent.
|
||||
// If the project is already running, this will return a 304 Not Modified
|
||||
util.PutRequest(ctx.Config.DaemonURL+"/app/"+projectName.Id+"/start", nil)
|
||||
err = util.PutRequest(ctx.Config.DaemonURL+"/app/"+projectName.Id+"/start", nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to start %s: %v", projectName.Name, err)
|
||||
}
|
||||
|
||||
fmt.Printf("Successfully started %s\n", projectName)
|
||||
fmt.Printf("Successfully started %s\n", projectName.Name)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -12,8 +12,11 @@ func StopCommand(ctx CommandCtx, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
util.PutRequest(ctx.Config.DaemonURL+"/app/"+projectName.Id+"/stop", nil)
|
||||
err = util.PutRequest(ctx.Config.DaemonURL+"/app/"+projectName.Id+"/stop", nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to stop %s: %v", projectName.Name, err)
|
||||
}
|
||||
|
||||
fmt.Printf("Successfully stopped %s\n", projectName)
|
||||
fmt.Printf("Successfully stopped %s\n", projectName.Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user