fix(cli): run binary through npm symlinks
This commit is contained in:
parent
4d985ead9f
commit
42b286e4f7
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@open-matrix/cli",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"description": "Matrix package-author CLI.",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user