@fuxi-ailabs/dsh-ecat 0.1.0-alpha.2 → 0.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/plugin.js +5 -2
package/package.json
CHANGED
package/src/plugin.js
CHANGED
|
@@ -295,11 +295,14 @@ export function apply(ctx, config = {}) {
|
|
|
295
295
|
// without a web server (tests, headless profiles) still loads the commands.
|
|
296
296
|
if (typeof ctx.inject === 'function') {
|
|
297
297
|
ctx.inject(['webServer'], (scope) => {
|
|
298
|
-
const
|
|
298
|
+
const configured = config.workspaceRoot || null;
|
|
299
299
|
scope.effect(() => scope.webServer.register({
|
|
300
300
|
kind: 'prefix',
|
|
301
301
|
path: '/ecat',
|
|
302
|
-
|
|
302
|
+
// A configured root wins; otherwise fall back to the last workspace a
|
|
303
|
+
// command resolved, then to the process cwd (a stale pointer must not
|
|
304
|
+
// point the panel at an unrelated tree).
|
|
305
|
+
handler: (req, res) => createEcatHandler(configured || rememberedWorkspace() || process.cwd())(req, res),
|
|
303
306
|
}), 'ecat: web ui');
|
|
304
307
|
});
|
|
305
308
|
}
|