Skip to content

Commit

Permalink
feat: add up/down commands
Browse files Browse the repository at this point in the history
Signed-off-by: Ales Verbic <verbotenj@blinklabs.io>
  • Loading branch information
verbotenj committed Feb 21, 2024
1 parent 3836326 commit 754e2fb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cmd/cardano-up/down.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"log/slog"

"github.com/spf13/cobra"
)

func downCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "down",
Short: "Stop all Docker containers",
Long: `Stops all started Docker containers.`,
RunE: func(cmd *cobra.Command, args []string) error {
// TODO: Implement the logic to stop all "stopped" containers

slog.Info("Not Implemented: All containers stopped successfully")
return nil
},
}
return cmd
}
2 changes: 2 additions & 0 deletions cmd/cardano-up/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func main() {
versionCommand(),
listAvailableCommand(),
installCommand(),
upCommand(),
downCommand(),
)

if err := rootCmd.Execute(); err != nil {
Expand Down
22 changes: 22 additions & 0 deletions cmd/cardano-up/up.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"log/slog"

"github.com/spf13/cobra"
)

func upCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "up",
Short: "Start all Docker containers",
Long: `Starts all stopped Docker containers.`,
RunE: func(cmd *cobra.Command, args []string) error {
// TODO: Implement the logic to start all "stopped" containers

slog.Info("Not Implemented: All containers started successfully")
return nil
},
}
return cmd
}

0 comments on commit 754e2fb

Please sign in to comment.