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

Detect windows UNC '\\' as well as 'X:' as an absolute flow path - use the path.isAbsolute function instead of rolling our own.

This commit is contained in:
Simon Hailes 2019-11-03 08:24:47 +00:00
parent 6f91786f4d
commit 72deee5d74

View File

@ -56,8 +56,9 @@ function init(_settings, _runtime) {
if (settings.flowFile) {
flowsFile = settings.flowFile;
// handle Unix and Windows "C:\"
if ((flowsFile[0] == "/") || (flowsFile[1] == ":")) {
// handle Unix and Windows "C:\" and Windows "\\" for UNC.
if (fspath.isAbsolute(flowsFile)) {
//if (((flowsFile[0] == "\\") && (flowsFile[1] == "\\")) || (flowsFile[0] == "/") || (flowsFile[1] == ":")) {
// Absolute path
flowsFullPath = flowsFile;
} else if (flowsFile.substring(0,2) === "./") {