mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Ensure existing files are migrated to first project
This commit is contained in:
parent
5498c6f87d
commit
6d02e70025
10
package.json
10
package.json
@ -58,6 +58,10 @@
|
||||
"mqtt": "2.15.1",
|
||||
"multer": "1.3.0",
|
||||
"mustache": "2.3.0",
|
||||
"node-red-node-email": "0.1.*",
|
||||
"node-red-node-feedparser": "0.1.*",
|
||||
"node-red-node-rbe": "0.1.*",
|
||||
"node-red-node-twitter": "0.1.*",
|
||||
"nopt": "4.0.1",
|
||||
"oauth2orize": "1.11.0",
|
||||
"on-headers": "1.0.1",
|
||||
@ -70,11 +74,7 @@
|
||||
"uglify-js": "3.3.6",
|
||||
"when": "3.7.8",
|
||||
"ws": "1.1.5",
|
||||
"xml2js": "0.4.19",
|
||||
"node-red-node-feedparser": "0.1.*",
|
||||
"node-red-node-email": "0.1.*",
|
||||
"node-red-node-twitter": "0.1.*",
|
||||
"node-red-node-rbe": "0.1.*"
|
||||
"xml2js": "0.4.19"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"bcrypt": "~1.0.3"
|
||||
|
@ -770,7 +770,7 @@ function createDefaultProject(user, project) {
|
||||
var flowFilePath;
|
||||
var credsFilePath;
|
||||
|
||||
if (project.files.migrateFiles) {
|
||||
if (project.migrateFiles) {
|
||||
var baseFlowFileName = project.files.flow || fspath.basename(project.files.oldFlow);
|
||||
var baseCredentialFileName = project.files.credentials || fspath.basename(project.files.oldCredentials);
|
||||
files.push(baseFlowFileName);
|
||||
@ -790,7 +790,7 @@ function createDefaultProject(user, project) {
|
||||
}
|
||||
return util.writeFile(credsFilePath,credentialData);
|
||||
}));
|
||||
delete project.files.migrateFiles;
|
||||
delete project.migrateFiles;
|
||||
project.files.flow = baseFlowFileName;
|
||||
project.files.credentials = baseCredentialFileName;
|
||||
} else {
|
||||
|
@ -307,7 +307,7 @@ function reloadActiveProject(action) {
|
||||
}
|
||||
function createProject(user, metadata) {
|
||||
// var userSettings = getUserGitSettings(user);
|
||||
if (metadata.files && metadata.files.migrateFiles) {
|
||||
if (metadata.files && metadata.migrateFiles) {
|
||||
// We expect there to be no active project in this scenario
|
||||
if (activeProject) {
|
||||
throw new Error("Cannot migrate as there is an active project");
|
||||
|
Loading…
Reference in New Issue
Block a user