Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/ws-daemon/cmd/content-initializer.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
"os"
9
10
"github.com/spf13/cobra"
11
12
"github.com/gitpod-io/gitpod/ws-daemon/pkg/content"
13
)
14
15
// contentInitializerCmd creates a workspace snapshot
16
var contentInitializerCmd = &cobra.Command{
17
Use: "content-initializer",
18
Short: "fork'ed by ws-daemon to initialize content",
19
Args: cobra.ExactArgs(0),
20
RunE: func(cmd *cobra.Command, args []string) error {
21
22
statsFd := os.NewFile(content.RUN_INITIALIZER_CHILD_STATS_FD, "stats")
23
24
err := content.RunInitializerChild(statsFd)
25
if err != nil {
26
return err
27
}
28
29
return nil
30
},
31
}
32
33
func init() {
34
clientCmd.AddCommand(contentInitializerCmd)
35
}
36
37