handle_service_envfiles: fix sed pattern and quoting for multiple entries#58
Merged
fila43 merged 1 commit intodevexp-db:masterfrom Apr 24, 2026
Merged
Conversation
pkhartsk
requested changes
Apr 22, 2026
Contributor
pkhartsk
left a comment
There was a problem hiding this comment.
Could you also separate local envfiles=... into two lines as per https://github.com/koalaman/shellcheck/wiki/SC2155 ? I don't think that || return there actually does anything
…ries systemctl show -p EnvironmentFiles outputs lines prefixed with 'EnvironmentFiles=' (plural). The sed command was using the singular 'EnvironmentFile=' which never matched, leaving paths un-stripped. Additionally, $envfiles was unquoted in the echo, causing the shell to collapse newlines between multiple entries into spaces. This broke the 'while read line' loop which relies on newline separation to iterate over each file path individually. Fix by quoting "$envfiles" to preserve newlines, and updating the sed pattern to match the plural 'EnvironmentFiles=' prefix. Separate 'local' declaration from the assignment so that '|| return' actually sees the systemctl exit code (SC2155). Fixes: devexp-db#54 Made-with: Cursor
2e7b9c0 to
fa9e5a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
systemctl show -p EnvironmentFiles outputs lines prefixed with
'EnvironmentFiles=' (plural). The sed command was using the singular
'EnvironmentFile=' which never matched, leaving paths un-stripped.
Additionally, $envfiles was unquoted in the echo, causing the shell to
collapse newlines between multiple entries into spaces. This broke the
'while read line' loop which relies on newline separation to iterate
over each file path individually.
Fix by quoting "$envfiles" to preserve newlines, and updating the sed
pattern to match the plural 'EnvironmentFiles=' prefix.
Fixes: #54