Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "module",
"exports": "./dist/index.js",
"bin": {
"fiddle-core": "dist/index.js"
"fiddle-core": "dist/cli.js"
},
"files": [
"dist",
Expand All @@ -30,7 +30,7 @@
"lint:prettier:fix": "prettier --write package.json src/**/*.ts tests/**/*.ts",
"make": "run-p build",
"prepublishOnly": "npm run make",
"start": "node dist/index.js",
"start": "node dist/cli.js",
"test": "vitest run",
"test:ci": "vitest run --coverage"
},
Expand Down
13 changes: 13 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node

import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';

import { runFromCommandLine } from './command-line.js';

if (
(await fs.promises.realpath(process.argv[1])) ===
fileURLToPath(import.meta.url)
) {
void runFromCommandLine(process.argv.slice(2));
}
Comment thread
dsanders11 marked this conversation as resolved.
12 changes: 0 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#!/usr/bin/env node

import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';

import { DefaultPaths, Paths } from './paths.js';
import {
ElectronBinary,
Expand Down Expand Up @@ -67,10 +62,3 @@ export {
compareVersions,
runFromCommandLine,
};

if (
(await fs.promises.realpath(process.argv[1])) ===
fileURLToPath(import.meta.url)
) {
void runFromCommandLine(process.argv.slice(2));
}