Skip to content

Commit

Permalink
[jsscripting] Support non unix file paths (openhab#11804)
Browse files Browse the repository at this point in the history
Fixes openhab#11801

Signed-off-by: Dan Cunningham <[email protected]>
Signed-off-by: Nick Waterton <[email protected]>
  • Loading branch information
digitaldan authored and NickWaterton committed Dec 30, 2021
1 parent 363627a commit ff9b405
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import static org.openhab.core.automation.module.script.ScriptEngineFactory.*;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.channels.SeekableByteChannel;
Expand Down Expand Up @@ -65,7 +66,7 @@ public class OpenhabGraalJSScriptEngine extends InvocationInterceptingScriptEngi
private static final String GLOBAL_REQUIRE = "require(\"@jsscripting-globals\");";
private static final String REQUIRE_WRAPPER_NAME = "__wraprequire__";
// final CommonJS search path for our library
private static final Path LOCAL_NODE_PATH = Paths.get("/node_modules");
private static final Path LOCAL_NODE_PATH = Paths.get(File.separator + "node_modules");

// these fields start as null because they are populated on first use
private @NonNullByDefault({}) String engineIdentifier;
Expand Down

0 comments on commit ff9b405

Please sign in to comment.