mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Handle project first-run without existing flow file
This commit is contained in:
parent
bbb9a3c63b
commit
b847e962aa
@ -781,9 +781,14 @@ function createDefaultProject(user, project) {
|
|||||||
files.push(baseCredentialFileName);
|
files.push(baseCredentialFileName);
|
||||||
flowFilePath = fspath.join(projectPath,baseFlowFileName);
|
flowFilePath = fspath.join(projectPath,baseFlowFileName);
|
||||||
credsFilePath = fspath.join(projectPath,baseCredentialFileName);
|
credsFilePath = fspath.join(projectPath,baseCredentialFileName);
|
||||||
|
if (fs.existsSync(project.files.oldFlow)) {
|
||||||
log.trace("Migrating "+project.files.oldFlow+" to "+flowFilePath);
|
log.trace("Migrating "+project.files.oldFlow+" to "+flowFilePath);
|
||||||
log.trace("Migrating "+project.files.oldCredentials+" to "+credsFilePath);
|
|
||||||
promises.push(fs.copy(project.files.oldFlow,flowFilePath));
|
promises.push(fs.copy(project.files.oldFlow,flowFilePath));
|
||||||
|
} else {
|
||||||
|
log.trace(project.files.oldFlow+" does not exist - creating blank file");
|
||||||
|
promises.push(util.writeFile(flowFilePath,"[]"));
|
||||||
|
}
|
||||||
|
log.trace("Migrating "+project.files.oldCredentials+" to "+credsFilePath);
|
||||||
runtime.nodes.setCredentialSecret(project.credentialSecret);
|
runtime.nodes.setCredentialSecret(project.credentialSecret);
|
||||||
promises.push(runtime.nodes.exportCredentials().then(function(creds) {
|
promises.push(runtime.nodes.exportCredentials().then(function(creds) {
|
||||||
var credentialData;
|
var credentialData;
|
||||||
|
Loading…
Reference in New Issue
Block a user