Massive architectural rework
This commit massively overhauls the project's structure to simplify development. Most parts are now correctly compartmentalized and dependencies are passed in a sane way rather than global variables galore xd.
This commit is contained in:
22
cmd/cli/commands/start.go
Normal file
22
cmd/cli/commands/start.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
util "github.com/juls0730/flux/internal/util/cli"
|
||||
)
|
||||
|
||||
func StartCommand(ctx CommandCtx, args []string) error {
|
||||
projectName, err := util.GetProject("start", args, ctx.Config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
fmt.Printf("Successfully started %s\n", projectName)
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user