diff --git a/package-lock.json b/package-lock.json index 3990e802b4..cc6576f7c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17299,6 +17299,7 @@ "fs-extra": "^11.1.1", "mkdirp": "^3.0.0", "pretty-ms": "^8.0.0", + "slash": "^5.0.0", "tmp": "^0.2.1", "trie-search": "^1.4.1", "uuid": "^9.0.0", @@ -18538,6 +18539,7 @@ "fs-extra": "^11.1.1", "mkdirp": "^3.0.0", "pretty-ms": "^8.0.0", + "slash": "^5.0.0", "tmp": "^0.2.1", "trie-search": "^1.4.1", "uuid": "^9.0.0", diff --git a/packages/builder/bin/prescan.sh b/packages/builder/bin/prescan.sh index 8040b21745..d36ac3ee3e 100755 --- a/packages/builder/bin/prescan.sh +++ b/packages/builder/bin/prescan.sh @@ -40,7 +40,7 @@ if [ -z "$KUI_PRESCAN" ]; then fi echo "compiling plugin registry $CLIENT_HOME to ${KUI_PRESCAN-default location}" -MAIN=$(node -e "console.log(require(\"$CLIENT_HOME/package.json\".replace(/^\/c\//, \"c:/\")).main)") +MAIN=$(node -e "path=\"$CLIENT_HOME/package.json\"; if (process.platform === 'win32') path = path.replace(/^\/([a-zA-Z])\//, \"\$1:/\"); console.log(require(path).main)") MAIN_PROXY=$(echo "$MAIN" | sed -E 's/\.min\.js/-proxy.min.js/') if [ -f "$MAIN" ] then KUI_HEADLESS=true node "$MAIN" -- kui internal scan diff --git a/packages/core/package.json b/packages/core/package.json index b8549af0a3..f981402d65 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -49,6 +49,7 @@ "fs-extra": "^11.1.1", "mkdirp": "^3.0.0", "pretty-ms": "^8.0.0", + "slash": "^5.0.0", "tmp": "^0.2.1", "trie-search": "^1.4.1", "uuid": "^9.0.0", diff --git a/packages/core/src/plugins/scanner.ts b/packages/core/src/plugins/scanner.ts index f71ed5b247..a2595fa450 100644 --- a/packages/core/src/plugins/scanner.ts +++ b/packages/core/src/plugins/scanner.ts @@ -17,6 +17,7 @@ import Debug from 'debug' const debug = Debug('core/plugins/scanner') +import slash from 'slash' import { join } from 'path' import { pluginRoot } from './plugins' @@ -197,7 +198,7 @@ const topologicalSortForScan = async ( debug('resolving %s', route) try { const module = { route, path: pluginPaths[route] } - await loadPlugin(route, pluginPaths[route], scanCache) + await loadPlugin(route, slash(pluginPaths[route]), scanCache) scanCache.flat.push(module) delete pluginPaths[route] } catch (err) { @@ -273,7 +274,7 @@ export const scanForModules = async (dir: string, quiet = false, filter: Filter await Promise.all( modules.map(async module => { - const modulePath = path.join(moduleDir, module) + const modulePath = slash(path.join(moduleDir, module)) const name = (parentPath ? `${parentPath}/` : '') + module try {