mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3139 from node-red/fs-promises
Fixes to fs promises so that an electron built version runs
This commit is contained in:
commit
068f425833
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var fs = require('fs-extra');
|
||||
var fs = require('fs');
|
||||
var fspath = require('path');
|
||||
|
||||
var runtime;
|
||||
@ -25,7 +25,7 @@ var exampleFlows = null;
|
||||
async function getFlowsFromPath(path) {
|
||||
var result = {};
|
||||
var validFiles = [];
|
||||
return fs.readdir(path).then(files => {
|
||||
return fs.promises.readdir(path).then(files => {
|
||||
var promises = [];
|
||||
if (files) {
|
||||
files.forEach(function(file) {
|
||||
|
@ -23,7 +23,7 @@
|
||||
var i18n = require("i18next");
|
||||
|
||||
var path = require("path");
|
||||
var fs = require("fs-extra");
|
||||
var fs = require("fs");
|
||||
|
||||
var defaultLang = "en-US";
|
||||
|
||||
@ -89,7 +89,7 @@ async function readFile(lng, ns) {
|
||||
return resourceCache[ns][lng];
|
||||
} else if (resourceMap[ns]) {
|
||||
const file = path.join(resourceMap[ns].basedir, lng, resourceMap[ns].file);
|
||||
const content = await fs.readFile(file, "utf8");
|
||||
const content = await fs.promises.readFile(file, "utf8");
|
||||
resourceCache[ns] = resourceCache[ns] || {};
|
||||
resourceCache[ns][lng] = JSON.parse(content.replace(/^\uFEFF/, ''));
|
||||
var baseLng = lng.split('-')[0];
|
||||
|
Loading…
Reference in New Issue
Block a user