feat(cli): set interactive stages in register command
This commit is contained in:
parent
561bfad7c5
commit
8f9d7506dc
3 changed files with 146 additions and 19 deletions
18
cmd/cmd.go
18
cmd/cmd.go
|
@ -5,33 +5,15 @@ import (
|
|||
"os"
|
||||
"strconv"
|
||||
|
||||
"gitea.com/gitea/act_runner/config"
|
||||
"gitea.com/gitea/act_runner/engine"
|
||||
"gitea.com/gitea/act_runner/runtime"
|
||||
|
||||
"github.com/mattn/go-isatty"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const version = "0.1.5"
|
||||
|
||||
// initLogging setup the global logrus logger.
|
||||
func initLogging(cfg config.Config) {
|
||||
isTerm := isatty.IsTerminal(os.Stdout.Fd())
|
||||
log.SetFormatter(&log.TextFormatter{
|
||||
DisableColors: !isTerm,
|
||||
FullTimestamp: true,
|
||||
})
|
||||
|
||||
if cfg.Debug {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
if cfg.Trace {
|
||||
log.SetLevel(log.TraceLevel)
|
||||
}
|
||||
}
|
||||
|
||||
func Execute(ctx context.Context) {
|
||||
task := runtime.NewTask("gitea", 0, nil, nil)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue