Writing my env file for a Windows path and it surprisingly doesn't work very well
When a double-quoted value contains \\ (an escaped literal backslash) immediately followed by a variable reference ($VAR or ${VAR}), the variable is not substituted.
Instead the literal text $VAR is left in the output, and the backslash is silently dropped.
.env file:
FOO=bar
RESULT="a\\\\$FOO"
Using dotenv 3.2.0, with require 'dotenv/load'
Expected: "a\\bar" (one literal backslash, then the substituted value of FOO)
Actual: "a$FOO" (backslash is gone, and $FOO is left as literal unsubstituted text)
Writing my env file for a Windows path and it surprisingly doesn't work very well
When a double-quoted value contains
\\(an escaped literal backslash) immediately followed by a variable reference ($VARor${VAR}), the variable is not substituted.Instead the literal text
$VARis left in the output, and the backslash is silently dropped..env file:
Using dotenv 3.2.0, with
require 'dotenv/load'Expected:
"a\\bar"(one literal backslash, then the substituted value ofFOO)Actual:
"a$FOO"(backslash is gone, and$FOOis left as literal unsubstituted text)