-
Notifications
You must be signed in to change notification settings - Fork 249
Read all store paths from profile item #1417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
723389d
to
6e40636
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -133,7 +133,8 @@ func ProfileListIndex(args *ProfileListIndexArgs) (int, error) { | |||
return -1, errors.Wrapf(err, "failed to get installable for %s", args.DevPkg.String()) | |||
} | |||
for _, item := range items { | |||
if pathInStore == item.nixStorePath { | |||
if len(item.nixStorePaths) == 1 && // this should always be true | |||
pathInStore == item.nixStorePaths[0] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thisshould be true, yes.
Should we assert that by erroring if len of item.nixStorePaths > 1
OR just iterate over the item.nixStorePaths so we don't mind if the assumption is violated and things keep working...
} | ||
nixStorePath := scanner.Text() | ||
nixStorePaths := strings.Fields(scanner.Text()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh TIL about strings.Fields
2f9c980
to
33692fa
Compare
3b27d43
to
2ca4543
Compare
33692fa
to
478b1ab
Compare
2ca4543
to
2166973
Compare
478b1ab
to
e53d6e1
Compare
Signed-off-by: Rodrigo Ipince <[email protected]>
instead of arbitrarily picking the first one
How was it tested?
CI tests