From cd3902f0672dd2d3dcc7eb9762ed816fcd9c6267 Mon Sep 17 00:00:00 2001 From: Sean Morris <640101+seanmorris@users.noreply.github.com> Date: Fri, 15 Dec 2023 23:17:05 -0500 Subject: [PATCH] PR comments. --- packages/php-wasm/universal/src/lib/base-php.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/php-wasm/universal/src/lib/base-php.ts b/packages/php-wasm/universal/src/lib/base-php.ts index 5f86466f60..cf3f78a252 100644 --- a/packages/php-wasm/universal/src/lib/base-php.ts +++ b/packages/php-wasm/universal/src/lib/base-php.ts @@ -627,17 +627,17 @@ export abstract class BasePHP implements IsomorphicLocalPHP { // https://linux.die.net/man/1/chmod const fromIsDir = fromStat.mode & 0o40000; - let toExists: boolean; + let destinationExists: boolean; try { FS.stat(toPath); - toExists = true; + destinationExists = true; } catch { - toExists = false; + destinationExists = false; } if (!fromIsDir) { - const file = FS.readFile(fromPath, { encoding: 'binary' }); + const file = this.readFileAsBuffer(fromPath); FS.writeFile(toPath, file); return; } @@ -648,7 +648,7 @@ export abstract class BasePHP implements IsomorphicLocalPHP { ); } - if (!toExists) { + if (!destinationExists) { FS.mkdir(toPath); }