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.
20 lines
386 B
Go
20 lines
386 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
util "github.com/juls0730/flux/internal/util/cli"
|
|
)
|
|
|
|
func StopCommand(ctx CommandCtx, args []string) error {
|
|
projectName, err := util.GetProject("stop", args, ctx.Config)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
util.PutRequest(ctx.Config.DaemonURL+"/app/"+projectName.Id+"/stop", nil)
|
|
|
|
fmt.Printf("Successfully stopped %s\n", projectName)
|
|
return nil
|
|
}
|