Skip to content

Commit

Permalink
fix(tmc): panic when cloud features are used without a repository (#1178
Browse files Browse the repository at this point in the history
)

# Reason for This Change

When the project uses a `terramate.config` block to declare the project
and it's not a git repository, the cloud sync features panic because
`git` metadata is required.

## Description of Changes

Added a fatal error in case git is not setup and a cloud sync flag is
provided.
  • Loading branch information
i4k-tm committed Oct 12, 2023
2 parents 8a171f5 + 89867d8 commit f3f0d8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/terramate/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ func (c *cli) runOnStacks() {
}

if c.parsedArgs.Run.CloudSyncDeployment || c.parsedArgs.Run.CloudSyncDriftStatus {
if !c.prj.isRepo {
fatal(errors.E("cloud features requires a git repository"))
}
c.ensureAllStackHaveIDs(orderedStacks)
c.detectCloudMetadata()
}
Expand Down

0 comments on commit f3f0d8e

Please sign in to comment.