puritys / nodejs-phplike

Porting PHP to Node.js
http://www.puritys.me/docs-blog/article-201
33 stars 12 forks source link

if_file, mkdir are not working synchronously #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

Idea of this package is great, but this issue hurts me badly.

if (!mkdir(MODULES_DIR)) {
    console.log("Error: Path '" + MODULES_DIR + "' exists, but is not a directory.");
    exit();
}

The code above enters if section even though I know there's no file or directory (so it will create one). Directory is created right after app exits. Assigning mkdir to variable doesn't help.

puritys commented 8 years ago

Thank you for reporting this bug, I fixed it now.

Here is the code diff: https://github.com/puritys/nodejs-phplike/commit/de3c0c6fcd5928ef78a24cc1d94bd114123f5ec7

New package: phplike@2.5.2