Skip to content

Commit

Permalink
Fix parsing of HTTPS repo origins
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Jun 30, 2024
1 parent 0cdb760 commit bfc3c12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/scaffold/tf.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ func writeBackendConfig(ctx context.Context, dir fs.FS, stdin io.Reader) (reterr
if err != nil {
return fmt.Errorf("failed to read repo origin: %w", err)
}
segments := strings.Split(origin.Path, "/")
repoPath := strings.TrimLeft(origin.Path, "/")
segments := strings.SplitN(repoPath, "/", 3)
if len(segments) < 2 {
return fmt.Errorf("invalid repo path: %s", origin.Path)
}
Expand Down

0 comments on commit bfc3c12

Please sign in to comment.