Skip to content

Commit c14b799

Browse files
authored
fix: incorreft path replacement when listing repos (#7)
1 parent cef3536 commit c14b799

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/pkg/functions/status.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ func FindManagedRepos(ctx context.Context, reposDir string) (status.OrgSet, erro
121121
// then it is a repository file
122122
if strings.HasSuffix(file, "repositories/terragrunt.hcl") {
123123

124+
// Strip the trailing / from the reposDir
125+
replaceDir := strings.TrimSuffix(reposDir, "/")
124126
// Replace relative path with absolute path
125-
file = strings.Replace(file, reposDir, absRootPath, 1)
127+
file = strings.Replace(file, replaceDir, absRootPath, 1)
126128

127129
log.Printf("Working on file: %s\n", file)
128130

0 commit comments

Comments
 (0)