Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
tests
  • Loading branch information
mtojek committed Jul 13, 2023
commit c503d156860777eb1a67624b645b17128311324a
5 changes: 2 additions & 3 deletions cli/templatepush.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,10 @@ func (r *RootCmd) templatePush() *clibase.Cmd {
var createTemplate bool
template, err := client.TemplateByName(inv.Context(), organization.ID, name)
if err != nil {
if create {
createTemplate = true
} else {
if !create {
return err
}
createTemplate = true
}

err = uploadFlags.checkForLockfile(inv)
Expand Down
5 changes: 4 additions & 1 deletion cli/templatepush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,13 @@ func TestTemplatePush(t *testing.T) {
write string
}{
{match: "Upload", write: "yes"},
{match: "template has been created"},
}
for _, m := range matches {
pty.ExpectMatch(m.match)
pty.WriteLine(m.write)
if m.write != "" {
pty.WriteLine(m.write)
}
}

waiter.RequireSuccess()
Expand Down