Skip to content
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

[Error] False positive grep match in distrobox-assemble #1228

Closed
pavelxdd opened this issue Feb 23, 2024 · 1 comment
Closed

[Error] False positive grep match in distrobox-assemble #1228

pavelxdd opened this issue Feb 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pavelxdd
Copy link
Contributor

pavelxdd commented Feb 23, 2024

If distrobox.ini contains init_hooks after the pre_init_hooks lines, then this line

if grep -q "${key}=" "${tmpfile}"; then

returns false positive, which prepends the init_hooks list with IFS symbol. Which laters results in init_hooks arguments prepended with && in the beggining so there's an error that && is unexpected in line : ; && cmd ...

I think this grep should be "^${key}=" "${tmpfile}" (note the line beginning ^ expression) which also fixes the issue described above. If hooks commands contain string which match the distrobox.ini keys, there will be no false positives.

@pavelxdd pavelxdd added the bug Something isn't working label Feb 23, 2024
@89luca89
Copy link
Owner

Thanks a lot @pavelxdd for the report 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants