* fix: make upstream sync actions target the selected remote Ensure fetch and pull actually honor upstream selection so fork maintenance works from the Git sidebar, and surface upstream branch status alongside the primary origin-tracking indicators. * feat: add Windows Electron desktop foundation * fix(electron): stabilize Windows desktop packaging * fix(electron): stabilize Windows desktop chrome Use native Windows titlebar behavior with an Alt-accessible hidden menu, and harden Windows dev command launching so the desktop app follows platform conventions. * fix(electron): stabilize Windows dev startup * fix(electron): clarify desktop artifact names * fix(electron): harden Windows desktop release and launch * fix(electron): address Windows release review * fix(electron): point updater and release links to org repo * Fix Windows settings persistence fallback * Fix Windows Electron dev startup * Add Windows Electron window controls * Fix Windows Electron install and opencode launch * fix: resolve git status for repositories without upstream Fixes repository detection stuck on Checking repository Handles git status when no upstream is configured Adds regression coverage for git status loading * Add Windows app menu button * fix: preserve file editor line endings * ci: add desktop release smoke workflow --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
import { spawn } from 'node:child_process';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
|
|
const env = { ...process.env };
|
|
|
|
if (process.platform === 'win32' && !env.CSC_LINK && !env.WINDOWS_CSC_LINK) {
|
|
env.CSC_IDENTITY_AUTO_DISCOVERY = 'false';
|
|
console.log('[electron] Windows code signing disabled; building unsigned installer.');
|
|
}
|
|
|
|
const bunBinaryCandidates = [
|
|
process.env.npm_execpath,
|
|
process.env.BUN_INSTALL ? path.join(process.env.BUN_INSTALL, 'bin', process.platform === 'win32' ? 'bun.exe' : 'bun') : null,
|
|
process.platform === 'win32' ? 'bun.exe' : 'bun',
|
|
].filter(Boolean);
|
|
|
|
const bunBinary = bunBinaryCandidates.find((candidate) => {
|
|
if (path.basename(candidate).toLowerCase().startsWith('bun')) {
|
|
return candidate === 'bun' || candidate === 'bun.exe' || fs.existsSync(candidate);
|
|
}
|
|
return false;
|
|
}) || (process.platform === 'win32' ? 'bun.exe' : 'bun');
|
|
|
|
const child = spawn(bunBinary, ['x', 'electron-builder', ...process.argv.slice(2)], {
|
|
env,
|
|
stdio: 'inherit',
|
|
});
|
|
|
|
child.on('exit', (code, signal) => {
|
|
if (signal) {
|
|
process.kill(process.pid, signal);
|
|
return;
|
|
}
|
|
process.exit(code ?? 1);
|
|
});
|
|
|
|
child.on('error', (error) => {
|
|
console.error('[electron] failed to start electron-builder:', error);
|
|
process.exit(1);
|
|
});
|