Skip to content

Commit d05f331

Browse files
committed
Flag: create
1 parent b4057bd commit d05f331

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

cli/templatepush.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func (r *RootCmd) templatePush() *clibase.Cmd {
163163
provisionerTags []string
164164
uploadFlags templateUploadFlags
165165
activate bool
166+
create bool
166167
)
167168
client := new(codersdk.Client)
168169
cmd := &clibase.Cmd{
@@ -290,6 +291,12 @@ func (r *RootCmd) templatePush() *clibase.Cmd {
290291
Default: "true",
291292
Value: clibase.BoolOf(&activate),
292293
},
294+
{
295+
Flag: "create",
296+
Description: "Create the template if it does not exist.",
297+
Default: "false",
298+
Value: clibase.BoolOf(&create),
299+
},
293300
cliui.SkipPromptOption(),
294301
}
295302
cmd.Options = append(cmd.Options, uploadFlags.options()...)

cli/testdata/coder_templates_push_--help.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Push a new template version from the current directory or as specified by flag
1010
Always prompt all parameters. Does not pull parameter values from
1111
active template version.
1212

13+
--create bool (default: false)
14+
Create the template if it does not exist.
15+
1316
-d, --directory string (default: .)
1417
Specify the directory to create from, use '-' to read tar from stdin.
1518

docs/cli/templates_push.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ Whether the new template will be marked active.
2929

3030
Always prompt all parameters. Does not pull parameter values from active template version.
3131

32+
### --create
33+
34+
| | |
35+
| ------- | ------------------ |
36+
| Type | <code>bool</code> |
37+
| Default | <code>false</code> |
38+
39+
Create the template if it does not exist.
40+
3241
### -d, --directory
3342

3443
| | |

0 commit comments

Comments
 (0)