fix(cli): run binary through npm symlinks

This commit is contained in:
Ubuntu 2026-06-08 18:11:03 +00:00
parent 4d985ead9f
commit 42b286e4f7
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@open-matrix/cli",
"version": "0.1.3",
"version": "0.1.4",
"description": "Matrix package-author CLI.",
"type": "module",
"bin": {

View File

@ -1,5 +1,6 @@
#!/usr/bin/env node
import { Command } from 'commander';
import { realpathSync } from 'node:fs';
import { pathToFileURL } from 'node:url';
import { initCommand } from './commands/init.js';
import { actorCommand } from './commands/actor.js';
@ -47,7 +48,7 @@ export function createProgram(): Command {
program
.name('matrix')
.description('Matrix SDK CLI for package authors')
.version('0.1.3');
.version('0.1.4');
const broker = program
.command('broker')
@ -854,7 +855,7 @@ async function main(): Promise<void> {
const invokedPath = process.argv[1];
const isDirectExecution = Boolean(invokedPath)
&& pathToFileURL(invokedPath).href === import.meta.url;
&& pathToFileURL(realpathSync(invokedPath)).href === import.meta.url;
if (isDirectExecution) {
main().catch((err) => {