Skip to content

Commit

Permalink
Make cwd resettable back to process.cwd()
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusGundersen committed Nov 30, 2023
1 parent e50653f commit 15b481b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/localModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15b481b

Please sign in to comment.