mirror of
https://github.com/actions/github-script.git
synced 2025-12-21 07:12:30 +00:00
Add a catch to support requiring installed modules
This commit is contained in:
@@ -4,8 +4,14 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
|
||||
apply: (target, thisArg, [moduleID]) => {
|
||||
if (moduleID.startsWith('.')) {
|
||||
moduleID = path.join(process.cwd(), moduleID)
|
||||
return target.apply(thisArg, [moduleID])
|
||||
}
|
||||
|
||||
try {
|
||||
return target.apply(thisArg, [moduleID])
|
||||
} catch (err) {
|
||||
return target.resolve(moduleID, {paths: [...module.paths, process.cwd()]})
|
||||
}
|
||||
return target.apply(thisArg, [moduleID])
|
||||
},
|
||||
|
||||
get: (target, prop, receiver) => {
|
||||
|
||||
Reference in New Issue
Block a user