-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (35 loc) · 925 Bytes
/
Copy pathmain.go
File metadata and controls
43 lines (35 loc) · 925 Bytes
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
41
42
43
package main
import (
"context"
"os"
"path"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v3"
"github.com/qaiser42/stackit-nuke/pkg/common"
_ "github.com/qaiser42/stackit-nuke/pkg/commands/list"
_ "github.com/qaiser42/stackit-nuke/pkg/commands/run"
_ "github.com/qaiser42/stackit-nuke/resources"
)
func main() {
defer func() {
if r := recover(); r != nil {
if _, ok := r.(*logrus.Entry); ok {
os.Exit(1)
}
panic(r)
}
}()
cmd := &cli.Command{
Name: path.Base(os.Args[0]),
Usage: "remove all resources from a STACKIT project",
Version: common.AppVersion.Summary,
Authors: []any{"stackit-nuke contributors"},
Commands: common.GetCommands(),
CommandNotFound: func(_ context.Context, _ *cli.Command, command string) {
logrus.Fatalf("Command %s not found.", command)
},
}
if err := cmd.Run(context.Background(), os.Args); err != nil {
logrus.Fatal(err)
}
}