mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
refactor: remove CommonJS launchers and use claude command directly
Remove local Claude launcher scripts and refactor to invoke the global claude command from PATH. This simplifies the launcher logic and removes the need to maintain separate CommonJS entry points. Changes: - Delete cli/scripts/claude_local_launcher.cjs, claude_remote_launcher.cjs, and claude_version_utils.cjs - Update claudeLocal to spawn 'claude' command directly instead of using a launcher script - Remove runtimePath dependency and launcher existence checks - Add DISABLE_AUTOUPDATER environment variable for local mode - Improve error messages when claude command is not found - Add shell option for Windows compatibility in process spawning - Remove unused imports from claudeLocal and index files
This commit is contained in:
@@ -116,9 +116,6 @@ function unpackTools(runtimeRoot: string): void {
|
||||
|
||||
function runtimeAssetsReady(runtimeRoot: string): boolean {
|
||||
const requiredScripts = [
|
||||
join(runtimeRoot, 'scripts', 'claude_local_launcher.cjs'),
|
||||
join(runtimeRoot, 'scripts', 'claude_remote_launcher.cjs'),
|
||||
join(runtimeRoot, 'scripts', 'claude_version_utils.cjs'),
|
||||
join(runtimeRoot, 'scripts', 'ripgrep_launcher.cjs')
|
||||
];
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { feature } from 'bun:bundle';
|
||||
|
||||
import claudeLocalLauncher from '../../scripts/claude_local_launcher.cjs' assert { type: 'file' };
|
||||
import claudeRemoteLauncher from '../../scripts/claude_remote_launcher.cjs' assert { type: 'file' };
|
||||
import claudeVersionUtils from '../../scripts/claude_version_utils.cjs' assert { type: 'file' };
|
||||
import ripgrepLauncher from '../../scripts/ripgrep_launcher.cjs' assert { type: 'file' };
|
||||
|
||||
import difftasticArchiveLicense from '../../tools/archives/difftastic-LICENSE' assert { type: 'file' };
|
||||
@@ -23,9 +20,6 @@ function asset(relativePath: string, sourcePath: string): EmbeddedAsset {
|
||||
}
|
||||
|
||||
const COMMON_ASSETS: EmbeddedAsset[] = [
|
||||
asset('scripts/claude_local_launcher.cjs', claudeLocalLauncher),
|
||||
asset('scripts/claude_remote_launcher.cjs', claudeRemoteLauncher),
|
||||
asset('scripts/claude_version_utils.cjs', claudeVersionUtils),
|
||||
asset('scripts/ripgrep_launcher.cjs', ripgrepLauncher),
|
||||
asset('tools/archives/difftastic-LICENSE', difftasticArchiveLicense),
|
||||
asset('tools/archives/ripgrep-LICENSE', ripgrepArchiveLicense),
|
||||
|
||||
Reference in New Issue
Block a user