-
Notifications
You must be signed in to change notification settings - Fork 0
/
new.go
40 lines (35 loc) · 875 Bytes
/
new.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//nolint:gochecknoglobals,gochecknoinits
package cmd
import (
"os"
"github.com/Defacto2/df2/cmd/internal/run"
"github.com/Defacto2/df2/pkg/database"
"github.com/spf13/cobra"
)
var newCmd = &cobra.Command{
Use: "new",
Short: "Manage files marked as waiting to go live (default).",
Aliases: []string{"n"},
GroupID: "group1",
Long: `Runs a sequence of commands to handle the files waiting to go live.
This is the default df2 command when used without any flags or arguments.
df2 demozoo --new
proof
fix images
fix text
fix demozoo
fix database`,
Run: func(cmd *cobra.Command, args []string) {
db, err := database.Connect(confg)
if err != nil {
logr.Fatal(err)
}
defer db.Close()
if err := run.New(db, os.Stdout, logr, confg); err != nil {
logr.Error(err)
}
},
}
func init() {
rootCmd.AddCommand(newCmd)
}