Skip to content

Commit

Permalink
refactor: remove custom dagger logger (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
aweris authored Oct 31, 2023
1 parent 6010726 commit d4fc8c4
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 257 deletions.
45 changes: 0 additions & 45 deletions ghx/dagger.go

This file was deleted.

4 changes: 2 additions & 2 deletions ghx/executor_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewContainerExecutorFromStepDocker(sd *StepDocker) *ContainerExecutor {
return &ContainerExecutor{
entrypoint: sd.Step.With["entrypoint"],
args: []string{sd.Step.With["args"]},
cp: NewEnvCommandsProcessor(),
cp: NewCommandProcessor(),
container: sd.container,
}
}
Expand All @@ -35,7 +35,7 @@ func NewContainerExecutorFromStepAction(sa *StepAction, entrypoint string) *Cont
return &ContainerExecutor{
entrypoint: entrypoint,
args: sa.Action.Meta.Runs.Args,
cp: NewEnvCommandsProcessor(),
cp: NewCommandProcessor(),
container: sa.container,
}
}
Expand Down
93 changes: 0 additions & 93 deletions ghx/journal/entry.go

This file was deleted.

92 changes: 0 additions & 92 deletions ghx/journal/pipe.go

This file was deleted.

4 changes: 3 additions & 1 deletion ghx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import (
"fmt"
"os"

"dagger.io/dagger"

"github.com/aweris/gale/common/fs"
"github.com/aweris/gale/ghx/context"
)

func main() {
stdctx := stdContext.Background()

client, err := getDaggerClient(stdctx)
client, err := dagger.Connect(stdctx, dagger.WithLogOutput(os.Stdout))
if err != nil {
fmt.Printf("failed to get dagger client: %v", err)
os.Exit(1)
Expand Down
24 changes: 0 additions & 24 deletions ghx/workflow_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,6 @@ type CommandProcessor struct {
exclude map[CommandName]bool // exclude is a map of command names to exclude from processing
}

// NewLoggingCommandProcessor creates a new command processor that processes logging commands.
func NewLoggingCommandProcessor() *CommandProcessor {
return NewCommandProcessor(
CommandNameSetEnv,
CommandNameSetOutput,
CommandNameSaveState,
CommandNameAddMask,
CommandNameAddMatcher,
CommandNameAddPath,
)
}

// NewEnvCommandsProcessor returns a new command processor that processes commands that manipulate execution environment.
func NewEnvCommandsProcessor() *CommandProcessor {
return NewCommandProcessor(
CommandNameGroup,
CommandNameEndGroup,
CommandNameDebug,
CommandNameError,
CommandNameWarning,
CommandNameNotice,
)
}

func NewCommandProcessor(excluded ...CommandName) *CommandProcessor {
exclude := make(map[CommandName]bool, len(excluded))

Expand Down

0 comments on commit d4fc8c4

Please sign in to comment.