mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
chore(cli): warn on template push or create when no lockfile present (#8059)
This commit is contained in:
@ -87,6 +87,11 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
|
||||
return xerrors.Errorf("A template already exists named %q!", templateName)
|
||||
}
|
||||
|
||||
err = uploadFlags.checkForLockfile(inv)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("check for lockfile: %w", err)
|
||||
}
|
||||
|
||||
// Confirm upload of the directory.
|
||||
resp, err := uploadFlags.upload(inv, client)
|
||||
if err != nil {
|
||||
@ -185,7 +190,6 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
|
||||
Default: "0h",
|
||||
Value: clibase.DurationOf(&inactivityTTL),
|
||||
},
|
||||
uploadFlags.option(),
|
||||
{
|
||||
Flag: "test.provisioner",
|
||||
Description: "Customize the provisioner backend.",
|
||||
@ -195,6 +199,7 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
|
||||
},
|
||||
cliui.SkipPromptOption(),
|
||||
}
|
||||
cmd.Options = append(cmd.Options, uploadFlags.options()...)
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user