fix(cli): restore openchamber startup under npm/bun global shims

This commit is contained in:
Bohdan Triapitsyn
2026-03-13 11:33:23 +02:00
parent 875491c438
commit d160263f4f
3 changed files with 29 additions and 3 deletions
+9
View File
@@ -36,6 +36,15 @@ describe('cli entry detection', () => {
expect(isModuleCliExecution('', moduleUrl)).toBe(false);
});
it('returns false when module url is not provided', () => {
expect(isModuleCliExecution(modulePath)).toBe(false);
});
it('accepts wrapper binary name fallback when requested', () => {
const wrapperPath = '/home/user/.local/bin/openchamber';
expect(isModuleCliExecution(wrapperPath, moduleUrl, undefined, 'openchamber')).toBe(true);
});
it('normalizes direct paths when realpath fails', () => {
const unresolvedPath = './packages/web/bin/cli.js';
const realpath = () => {