Upgrade urfave/cli to v2 (#483)

* migrate urfave/ci v1 -> v2
* refactor cli (format flag)
* log error if agent can not listen on port 3000

close #452
This commit is contained in:
6543
2021-10-27 21:03:14 +02:00
committed by GitHub
parent d35f5158bc
commit 798c2bc8b2
121 changed files with 8407 additions and 1346 deletions

View File

@@ -1,12 +1,17 @@
package log
import "github.com/urfave/cli"
import (
"github.com/urfave/cli/v2"
"github.com/woodpecker-ci/woodpecker/cli/common"
)
// Command exports the build command set.
var Command = cli.Command{
var Command = &cli.Command{
Name: "log",
Usage: "manage logs",
Subcommands: []cli.Command{
Flags: common.GlobalFlags,
Subcommands: []*cli.Command{
logPurgeCmd,
},
}

View File

@@ -4,16 +4,18 @@ import (
"fmt"
"strconv"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/woodpecker-ci/woodpecker/cli/common"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)
var logPurgeCmd = cli.Command{
var logPurgeCmd = &cli.Command{
Name: "purge",
Usage: "purge a log",
ArgsUsage: "<repo/name> <build>",
Action: logPurge,
Flags: common.GlobalFlags,
}
func logPurge(c *cli.Context) (err error) {