diff options
Diffstat (limited to 'src/helpers/recipe-helpers.ts')
-rw-r--r-- | src/helpers/recipe-helpers.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/helpers/recipe-helpers.ts b/src/helpers/recipe-helpers.ts index 965429210..65ef04088 100644 --- a/src/helpers/recipe-helpers.ts +++ b/src/helpers/recipe-helpers.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | /* eslint-disable global-require */ | ||
1 | import { parse } from 'path'; | 2 | import { parse } from 'path'; |
2 | import { userDataRecipesPath } from '../environment'; | 3 | import { userDataRecipesPath } from '../environment'; |
3 | 4 | ||
@@ -15,20 +16,17 @@ export function loadRecipeConfig(recipeId: string) { | |||
15 | // Delete module from cache | 16 | // Delete module from cache |
16 | delete require.cache[require.resolve(configPath)]; | 17 | delete require.cache[require.resolve(configPath)]; |
17 | 18 | ||
18 | // eslint-disable-next-line | 19 | // eslint-disable-next-line import/no-dynamic-require |
19 | let config = require(configPath); | 20 | const config = require(configPath); |
20 | 21 | ||
21 | const moduleConfigPath = require.resolve(configPath); | 22 | const moduleConfigPath = require.resolve(configPath); |
22 | config.path = parse(moduleConfigPath).dir; | 23 | config.path = parse(moduleConfigPath).dir; |
23 | 24 | ||
24 | return config; | 25 | return config; |
25 | } catch (e) { | 26 | } catch (error) { |
26 | console.error(e); | 27 | console.error(error); |
27 | return null; | 28 | return null; |
28 | } | 29 | } |
29 | } | 30 | } |
30 | 31 | ||
31 | module.paths.unshift( | 32 | module.paths.unshift(getDevRecipeDirectory(), getRecipeDirectory()); |
32 | getDevRecipeDirectory(), | ||
33 | getRecipeDirectory(), | ||
34 | ); | ||