Skip to content

Commit

Permalink
chore: move to task package
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie committed Feb 16, 2025
1 parent 1575dac commit b318ca5
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions cmd/runproc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"

"github.com/spf13/cobra"
"github.com/zeiss/pkg/cmd/runproc/task"
)

type config struct {
Expand Down Expand Up @@ -44,13 +45,13 @@ func runRoot(ctx context.Context) error {
buf.WriteString("\n")
buf.Write(envData)

tasks, err := Parse(buf)
tasks, err := task.Parse(buf)
if err != nil {
log.Fatalln(err)
}
log.SetFlags(log.Lshortfile)

run := NewRunner(tasks)
run := task.NewRunner(tasks)

err = run.Run(ctx)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/runproc/parse.go → cmd/runproc/task/parse.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion cmd/runproc/prefixer.go → cmd/runproc/task/prefixer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion cmd/runproc/process.go → cmd/runproc/task/process.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

type ProcessRunner interface {
Start()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

import (
"time"
Expand Down
2 changes: 1 addition & 1 deletion cmd/runproc/runner.go → cmd/runproc/task/runner.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion cmd/runproc/task.go → cmd/runproc/task/task.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package task

type Task struct {
// Name used in logs
Expand Down

0 comments on commit b318ca5

Please sign in to comment.