Skip to content

Commit

Permalink
searchStacks: append a trailing / as a viable project_root (#135)
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Exton <[email protected]>
  • Loading branch information
lexton and lexton authored Apr 4, 2023
1 parent b8c5b52 commit 04b3a55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/cmd/stack/open_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ func searchStacks(ctx context.Context, p *stackSearchParams) ([]stack, error) {
}

if p.projectRoot != nil {
root := strings.TrimSuffix(*p.projectRoot, "/")
conditions = append(conditions, structs.QueryPredicate{
Field: graphql.String("projectRoot"),
Constraint: structs.QueryFieldConstraint{
StringMatches: &[]graphql.String{graphql.String(*p.projectRoot)},
StringMatches: &[]graphql.String{graphql.String(root), graphql.String(root + "/")},
},
})
}
Expand Down

0 comments on commit 04b3a55

Please sign in to comment.