1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Handle windows paths for context storage

This commit is contained in:
Nick O'Leary 2018-08-15 15:31:42 +01:00
parent ef8b936069
commit d132d63c1d
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -150,7 +150,7 @@ LocalFileSystem.prototype.open = function(){
var promises = []; var promises = [];
return listFiles(self.storageBaseDir).then(function(files) { return listFiles(self.storageBaseDir).then(function(files) {
files.forEach(function(file) { files.forEach(function(file) {
var parts = file.split("/"); var parts = file.split(path.sep);
if (parts[0] === 'global') { if (parts[0] === 'global') {
scopes.push("global"); scopes.push("global");
} else if (parts[1] === 'flow.json') { } else if (parts[1] === 'flow.json') {
@ -338,7 +338,7 @@ LocalFileSystem.prototype.clean = function(_activeNodes) {
return cachePromise.then(() => listFiles(self.storageBaseDir)).then(function(files) { return cachePromise.then(() => listFiles(self.storageBaseDir)).then(function(files) {
var promises = []; var promises = [];
files.forEach(function(file) { files.forEach(function(file) {
var parts = file.split("/"); var parts = file.split(path.sep);
var removePromise; var removePromise;
if (parts[0] === 'global') { if (parts[0] === 'global') {
// never clean global // never clean global