Merge pull request #19 from liuxiaopai-ai/feat/linux-build-support
Code review approved: clean Linux build support, correct platform handling.
This commit is contained in:
5 files changed
+28
-9
No files matched your search
@@ -55,8 +55,7 @@ Pre-built releases are available on the [**Releases**](https://github.com/op7418
|
||||
|
||||
- **macOS**: Universal binary (arm64 + x64) distributed as `.dmg`
|
||||
- **Windows**: x64 distributed as `.zip`
|
||||
|
||||
> Linux builds are planned. Contributions welcome.
|
||||
- **Linux**: x64 and arm64 distributed as `.AppImage`, `.deb`, and `.rpm`
|
||||
|
||||
---
|
||||
|
||||
|
||||
+1
-2
@@ -74,8 +74,7 @@ npm run electron:dev
|
||||
|
||||
- **macOS** -- 支持 arm64(Apple Silicon)和 x64(Intel)架构的 `.dmg` 安装包
|
||||
- **Windows** -- 提供 `.zip` 压缩包,解压即用
|
||||
|
||||
> **Linux** 版本正在计划中,欢迎贡献。
|
||||
- **Linux** -- 支持 x64 和 arm64 架构,提供 `.AppImage`、`.deb` 和 `.rpm` 格式
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -56,3 +56,19 @@ nsis:
|
||||
allowToChangeInstallationDirectory: true
|
||||
createDesktopShortcut: true
|
||||
createStartMenuShortcut: true
|
||||
linux:
|
||||
icon: build/icon.png
|
||||
category: Development
|
||||
artifactName: "${productName}-${version}-${arch}.${ext}"
|
||||
desktop:
|
||||
Name: CodePilot
|
||||
Comment: A native desktop GUI for Claude Code
|
||||
Categories: Development;IDE;
|
||||
StartupWMClass: codepilot
|
||||
target:
|
||||
- target: AppImage
|
||||
arch: [x64, arm64]
|
||||
- target: deb
|
||||
arch: [x64, arm64]
|
||||
- target: rpm
|
||||
arch: [x64, arm64]
|
||||
+8
-4
@@ -71,12 +71,13 @@ function checkNativeModuleABI(): void {
|
||||
|
||||
/**
|
||||
* Read the user's full shell environment by running a login shell.
|
||||
* When Electron is launched from Dock/Finder, process.env is very limited
|
||||
* and won't include vars from .zshrc/.bashrc (e.g. API keys).
|
||||
* When Electron is launched from Dock/Finder (macOS) or desktop launcher
|
||||
* (Linux), process.env is very limited and won't include vars from
|
||||
* .zshrc/.bashrc (e.g. API keys, nvm PATH).
|
||||
*/
|
||||
function loadUserShellEnv(): Record<string, string> {
|
||||
// Only macOS needs login-shell env loading; Windows/Linux GUI apps inherit full env
|
||||
if (process.platform !== 'darwin') {
|
||||
// Windows GUI apps inherit the full user environment
|
||||
if (process.platform === 'win32') {
|
||||
return {};
|
||||
}
|
||||
try {
|
||||
@@ -250,6 +251,9 @@ function getIconPath(): string {
|
||||
if (process.platform === 'win32') {
|
||||
return path.join(process.resourcesPath, 'icon.ico');
|
||||
}
|
||||
if (process.platform === 'linux') {
|
||||
return path.join(process.resourcesPath, 'icon.png');
|
||||
}
|
||||
return path.join(process.resourcesPath, 'icon.icns');
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@
|
||||
"electron:build": "next build && node scripts/build-electron.mjs",
|
||||
"electron:pack": "npm run electron:build && electron-builder --config electron-builder.yml",
|
||||
"electron:pack:mac": "npm run electron:build && electron-builder --mac --config electron-builder.yml",
|
||||
"electron:pack:win": "npm run electron:build && electron-builder --win --config electron-builder.yml"
|
||||
"electron:pack:win": "npm run electron:build && electron-builder --win --config electron-builder.yml",
|
||||
"electron:pack:linux": "npm run electron:build && electron-builder --linux --config electron-builder.yml"
|
||||
},
|
||||
"dependencies": {
|
||||
"@anthropic-ai/claude-agent-sdk": "^0.2.33",
|
||||
|
||||
Reference in new issue
Block a user