mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Shuffle promises for creating default package.json
This commit is contained in:
parent
50017c28da
commit
f2235dacdc
@ -231,22 +231,24 @@ var localfilesystem = {
|
||||
globalSettingsFile = fspath.join(settings.userDir,".config.json");
|
||||
|
||||
var packageFile = fspath.join(settings.userDir,"package.json");
|
||||
|
||||
var packagePromise = when.resolve();
|
||||
if (!settings.readOnly) {
|
||||
promises.push(promiseDir(libFlowsDir));
|
||||
try {
|
||||
fs.statSync(packageFile);
|
||||
} catch(err) {
|
||||
var defaultPackage = {
|
||||
"name": "node-red-project",
|
||||
"description": "A Node-RED Project",
|
||||
"version": "0.0.1"
|
||||
};
|
||||
promises.push(writeFile(packageFile,JSON.stringify(defaultPackage,"",4)));
|
||||
packagePromise = function() {
|
||||
try {
|
||||
fs.statSync(packageFile);
|
||||
} catch(err) {
|
||||
var defaultPackage = {
|
||||
"name": "node-red-project",
|
||||
"description": "A Node-RED Project",
|
||||
"version": "0.0.1"
|
||||
};
|
||||
return writeFile(packageFile,JSON.stringify(defaultPackage,"",4));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return when.all(promises);
|
||||
return when.all(promises).then(packagePromise);
|
||||
},
|
||||
|
||||
getFlows: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user