Skip to content

Commit

Permalink
PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorris committed Dec 16, 2023
1 parent 9e8453b commit cd3902f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/php-wasm/universal/src/lib/base-php.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -648,7 +648,7 @@ export abstract class BasePHP implements IsomorphicLocalPHP {
);
}

if (!toExists) {
if (!destinationExists) {
FS.mkdir(toPath);
}

Expand Down

0 comments on commit cd3902f

Please sign in to comment.