@toothfairyai/tfcode 1.0.0-beta.7 → 1.0.0-beta.9
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/bin/tfcode.js +6 -6
- package/package.json +1 -1
package/bin/tfcode.js
CHANGED
|
@@ -4,9 +4,13 @@ import yargs from 'yargs';
|
|
|
4
4
|
import { hideBin } from 'yargs/helpers';
|
|
5
5
|
import { spawn } from 'child_process';
|
|
6
6
|
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
7
|
-
import { join } from 'path';
|
|
7
|
+
import { join, dirname } from 'path';
|
|
8
8
|
import { homedir } from 'os';
|
|
9
9
|
import * as readline from 'readline';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = dirname(__filename);
|
|
10
14
|
|
|
11
15
|
const TFCODE_DIR = join(homedir(), '.tfcode');
|
|
12
16
|
const TOOLS_FILE = join(TFCODE_DIR, 'tools.json');
|
|
@@ -446,12 +450,8 @@ const cli = yargs(hideBin(process.argv))
|
|
|
446
450
|
.command({
|
|
447
451
|
command: '*',
|
|
448
452
|
describe: 'start tfcode TUI',
|
|
449
|
-
handler:
|
|
453
|
+
handler: () => {
|
|
450
454
|
// Try to run the full TUI
|
|
451
|
-
const { spawn } = require('child_process');
|
|
452
|
-
const { existsSync } = require('fs');
|
|
453
|
-
const { join } = require('path');
|
|
454
|
-
|
|
455
455
|
// Check if we're in the source repo
|
|
456
456
|
const possiblePaths = [
|
|
457
457
|
join(__dirname, '..', 'src', 'index.ts'),
|