chore(cli): warn on template push or create when no lockfile present (#8059)

This commit is contained in:
Colin Adler
2023-06-20 10:02:44 -05:00
committed by GitHub
parent a47a9b1cfe
commit adf14f1917
11 changed files with 272 additions and 8 deletions

View File

@ -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
}