From babd64195d666972d5f633d95f8be5d7b16189bc Mon Sep 17 00:00:00 2001 From: Christopher Borchert Date: Tue, 16 May 2023 12:04:42 +0200 Subject: [PATCH] sanitize appdir variable in case it's coming from a windows environment --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index fe5417b..44f6595 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,9 @@ -module.exports = ({appdir}) => { +module.exports = ({appdir: originalAppDir = ''}) => { + + // if the kernel is instantiated in a windows environment, the appdir will contain backslashes + // correct this by replacing all backslashes with forward slashes + const appdir = originalAppDir.replace(/\\/g, '/'); + const fs = require('fs'); const path = require('path'); const glob = require('glob');