diff --git a/packages/nx/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.ts b/packages/nx/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.ts index de32897c0eb42..a335cdb10fb89 100644 --- a/packages/nx/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.ts +++ b/packages/nx/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.ts @@ -64,6 +64,11 @@ function parseEnvFile(tree: Tree, envFilePath: string) { .split('\n') .map((line) => { line = line.trim(); + + if (!line.includes('$')) { + return line; + } + const declarations = line.split('='); if (declarations[1].includes('$') && !declarations[1].includes(`\\$`)) { declarations[1] = declarations[1].replace('$', `\\$`);