Skip to content

Commit 8526a31

Browse files
feat: add a way to read version in pullTemplates command
1 parent ff53cf0 commit 8526a31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/pullTemplates.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
)
1010

1111
var (
12+
version string
1213
languageTemplate string
1314
all bool
1415
)
@@ -17,9 +18,8 @@ var (
1718
var pullTemplatesCmd = &cobra.Command{
1819
Use: "pullTemplates",
1920
Short: "Pulls the compage supported templates in the ~/.compage/templates directory",
20-
Long: `Compage supports multiple templates for different languages. You can pull just the required template by lana or all the templates.`,
21+
Long: `Compage supports multiple templates for different languages. You can pull just the required template by language or all the templates.`,
2122
Run: func(cmd *cobra.Command, args []string) {
22-
version := "latest"
2323
// common template is required for all the languages
2424
err := ociregistry.PullOCIArtifact("common", version)
2525
cobra.CheckErr(err)
@@ -61,4 +61,5 @@ func init() {
6161
// pullTemplatesCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
6262
pullTemplatesCmd.Flags().BoolVar(&all, "all", false, "all templates")
6363
pullTemplatesCmd.Flags().StringVar(&languageTemplate, "language", "go", "language template")
64+
pullTemplatesCmd.Flags().StringVar(&version, "version", "v1.0.0", "Version (latest, v1.0.0 - matching your version)")
6465
}

0 commit comments

Comments
 (0)