Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/workspacekit/cmd/root.go
2498 views
1
// Copyright (c) 2020 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
11
"github.com/spf13/cobra"
12
13
"github.com/gitpod-io/gitpod/common-go/log"
14
)
15
16
// rootCmd represents the base command when called without any subcommands
17
var rootCmd = &cobra.Command{
18
Use: "workspacekit",
19
Short: "Prepares a container for running a Gitpod workspace",
20
}
21
22
var (
23
// ServiceName is the name we use for tracing/logging
24
ServiceName = "workspacekit"
25
// Version of this service - set during build
26
Version = ""
27
)
28
29
// Execute adds all child commands to the root command and sets flags appropriately.
30
// This is called by main.main(). It only needs to happen once to the rootCmd.
31
func Execute() {
32
log.Init(ServiceName, Version, true, false)
33
34
if err := rootCmd.Execute(); err != nil {
35
fmt.Println(err)
36
os.Exit(1)
37
}
38
}
39
40