Skip to content

Commit

Permalink
Trim git suffix from repo origin
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Jun 30, 2024
1 parent bfc3c12 commit 21b8a97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/scaffold/scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (

const expectedBackendConfig = `terraform {
backend "http" {
address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend.git/default"
lock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend.git/default"
unlock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend.git/default"
address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend/default"
lock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend/default"
unlock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend/default"
username = "github_pat"
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/scaffold/tf.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func writeBackendConfig(ctx context.Context, dir fs.FS, stdin io.Reader) (reterr
return fmt.Errorf("invalid repo path: %s", origin.Path)
}
repo := segments[1]
repo = strings.TrimSuffix(repo, ".git")

backendURL, err := url.Parse(backendAddress)
if err != nil {
Expand Down

0 comments on commit 21b8a97

Please sign in to comment.