Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/image-builder-bob/cmd/root.go
2498 views
1
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cmd
6
7
import (
8
"fmt"
9
"os"
10
"time"
11
12
log "github.com/gitpod-io/gitpod/common-go/log"
13
"github.com/sirupsen/logrus"
14
"github.com/spf13/cobra"
15
)
16
17
// rootCmd represents the base command when called without any subcommands
18
var rootCmd = &cobra.Command{
19
Use: "bob",
20
Short: "Bob is the in-workspace component of the image builder. You should never have to interact with it directly.",
21
}
22
23
// Execute runs the root command
24
func Execute() {
25
log.Init("bob", "", true, false)
26
if err := rootCmd.Execute(); err != nil {
27
fmt.Println(err)
28
29
if log.Log.Logger.IsLevelEnabled(logrus.DebugLevel) {
30
time.Sleep(1 * time.Minute)
31
}
32
33
os.Exit(1)
34
}
35
}
36
37
func init() {
38
}
39
40