fix(ddev): strip CRLF from parsed ddev hostnames, fixes #46 - #53
Merged
Conversation
A Windows-edited .ddev/config.yaml carries \r line endings; block-list
items (additional_hostnames/additional_fqdns) kept theirs, so a hostname
came out as "name\r.tld": the terminal renders the .local tail at
column 0 (".localosts (win)", ".localdd:") and the hosts-file grep
never matches — an added hostname stayed "missing" forever. Strip \r
per record in the awk list parser; regression tests cover list output
and missing detection against clean and CRLF hosts files.
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.
Problem
opk statusreported missing Windows hosts entries with garbled output(
.localosts (win),.localdd:instead of⚠ hosts (win)/add:), and users reported additional hostnames without their tld(e.g.
meister-der-elementeinstead ofmeister-der-elemente.local).Root cause
A Windows-edited
.ddev/config.yamlcarries CRLF line endings. The awklist parser in
_ddev_hosts_yaml_listkept the\ron block-list items,so an
additional_hostnamesentry came out asname\r.local:\rmid-line — the.localtail is printed at column 0 and overwrites the line start(
⚠ hosts→.localosts,add:→.localdd:). The tld wasappended correctly all along; it just jumped visually.
name\r.local(...)and never matched — a hostname stayed "missing"forever even after the user added it.
name:/project_tld:were unaffected (their sed pipeline runstr -d '[:space:]'), which is why the primary URL always showed clean.Fix
Strip
\rper record in the awk parser ofddev-hosts.sh(one-line CRLFguard). Fixes status output, the
ddev()hook hint,opk ddev-hosts-checkand
opk ddev-hosts-addargument passing in one place.Tests
make testandmake lintgreen; e2e unaffected (LF fixtures)Also bumps VERSION to 0.0.28.
Fixes #46