samedi 28 mars 2015

Node, copy file from module to project

I try to create a node module and make a postinstall script (into package.json) who copy a js file into the current project like this :



fs.copy(appDir + "/schedule.js", appDir + "/../../config/schedule.js", function (err)
{
if (err)
{
console.log(err);
}
else
{
fs.chmod(appDir + "/../../config/schedule.js", 0755, function (err, succ)
{
console.log(err, succ);
});
console.log("done write schedule.js base config");

}
});


The problem is the file correctly copy but it's lock and can't be edited... Chmod doesn't return error. I'm under max OS X with node js 0.10.33 (IDE IntelliJ)


Aucun commentaire:

Enregistrer un commentaire