From 15b481bb08a2fc844753288fadb8a13248a273b2 Mon Sep 17 00:00:00 2001 From: Marius Gundersen Date: Thu, 30 Nov 2023 15:30:28 +0100 Subject: [PATCH] Make cwd resettable back to process.cwd() --- plugins/localModules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/localModules.js b/plugins/localModules.js index e862906..8b26ec7 100644 --- a/plugins/localModules.js +++ b/plugins/localModules.js @@ -29,12 +29,13 @@ name : "Path to modules", description : "The filesystem path to use when looking for modules. When calling require('./foo.js') it will load the file at MODULES_CWD+'./foo.js'.", type : "string", - defaultValue : process.cwd() + defaultValue : "" }); Espruino.addProcessor("getModule", function (data, callback) { var espruino_modules = Espruino.Config.MODULES_DIR_NAME; var cwd = Espruino.Config.MODULES_CWD; + if (!cwd) cwd = process.cwd(); /** * Implements the require.resolve() rules as per node