Skip to content

Commit 2ca7454

Browse files
committed
Fix release e2e local testing: use printf instead of echo -e for gradle.properties
On macOS, /bin/sh's echo does not support -e, so `echo -e "\n..." >> android/gradle.properties` appends a literal "-e " onto the preceding property (e.g. android.newDsl=false becomes android.newDsl=false-e ), which Gradle then fails to parse: Cannot parse project property android.newDsl='false-e ' of type 'class java.lang.String' as boolean. Expected 'true' or 'false'. Use printf, which is portable across shells, to append the react.internal.mavenLocalRepo line.
1 parent 6c483a1 commit 2ca7454

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/release-testing/test-release-local.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,11 @@ async function testRNTestProject(
290290

291291
cd('RNTestProject');
292292

293-
// need to do this here so that Android will be properly setup either way
293+
// need to do this here so that Android will be properly setup either way.
294+
// Use printf, not `echo -e`: on macOS /bin/sh's echo doesn't support -e, so
295+
// it appends a literal "-e " onto the previous property and corrupts the file.
294296
exec(
295-
`echo -e "\nreact.internal.mavenLocalRepo=${mavenLocalPath}" >> android/gradle.properties`,
297+
`printf '\\nreact.internal.mavenLocalRepo=%s\\n' "${mavenLocalPath}" >> android/gradle.properties`,
296298
);
297299

298300
// Only build the simulator architecture. CI is however generating only that one.

0 commit comments

Comments
 (0)