From cbf27849c0acc5d622e625208c50c0b89d84967b Mon Sep 17 00:00:00 2001 From: Akshaj Singhal Date: Wed, 3 Jun 2026 06:20:42 +0000 Subject: [PATCH] migrate to a python-first entry point --- bin/index.js | 41 ----------------------------------------- package.json | 9 +-------- 2 files changed, 1 insertion(+), 49 deletions(-) delete mode 100755 bin/index.js diff --git a/bin/index.js b/bin/index.js deleted file mode 100755 index ef9bc87..0000000 --- a/bin/index.js +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env node - -const { execFileSync, spawn } = require('child_process'); -const path = require('path'); - -// Try python3 first, fallback to python -const pythonCmd = (() => { - try { - execFileSync('python3', ['--version'], { stdio: 'ignore' }); - return 'python3'; - } catch { - return 'python'; - } -})(); - -// Check if Python is available and functional -const result = execFileSync(pythonCmd, ['--version'], { encoding: 'utf8', stdio: 'pipe' }); -if (!result) { - console.error('TruShell requires Python 3.10+. Please install Python first.'); - process.exit(1); -} - -const args = process.argv.slice(2); -const packageRoot = path.resolve(__dirname, '..'); - -const child = spawn(pythonCmd, ['-m', 'trushell', ...args], { - stdio: 'inherit', - cwd: packageRoot, -}); - -child.on('exit', (code, signal) => { - if (signal) process.kill(process.pid, signal); - process.exit(code); -}); - -child.on('error', (err) => { - console.error('Failed to launch TruShell CLI.'); - console.error('Make sure Python is installed and the TruShell package files are present.'); - console.error(err.message || err); - process.exit(1); -}); diff --git a/package.json b/package.json index 7fda08b..736040c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "@truos/trushell", "version": "1.0.2", "description": "TruShell - A modern terminal-based operating workspace interface", - "main": "bin/index.js", "type": "commonjs", "directories": { "test": "tests" @@ -11,14 +10,8 @@ "test": "echo \"Error: no test specified\" && exit 1", "postinstall": "pip install typer rich pyjokes cowsay pytz platformdirs textual || pip3 install typer rich pyjokes cowsay pytz platformdirs textual" }, - "bin": { - "truos": "./bin/index.js", - "trushell": "./bin/index.js", - "atoffice-shell": "./bin/index.js", - "TruOS": "./bin/index.js" - }, + "files": [ - "bin/", "trushell/", "README.md", "LICENSE"