Skip to content

Commit e949ecc

Browse files
konardclaude
andcommitted
fix(core): escape backslash in sed command for CRLF stripping in Dockerfile template
The sed pattern 's/\r$//' in a TypeScript template string was being interpreted as a literal carriage return (\r), producing invalid shell syntax in the generated Dockerfile. Escaping to '\\r' ensures the generated Dockerfile contains the literal text '\r', correctly stripping Windows-style CRLF line endings from entrypoint.sh. INVARIANT: ∀ generated Dockerfile: sed pattern renders as 's/\r$//' in shell PURITY: CORE - pure template transformation, no side effects Fixes #151 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 856dbf3 commit e949ecc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/lib/src/core/templates/dockerfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ RUN mkdir -p ${config.targetDir} \
225225
&& if [ "${config.targetDir}" != "/" ]; then chown -R 1000:1000 "${config.targetDir}"; fi
226226
227227
COPY entrypoint.sh /entrypoint.sh
228-
RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
228+
RUN sed -i 's/\\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
229229
230230
EXPOSE 22
231231
ENTRYPOINT ["/entrypoint.sh"]`

0 commit comments

Comments
 (0)