Windows checkouts: .gitattributes keeps text files LF (CRLF skills broke gen-adapters); findInstalled builds macOS/Linux paths with posix join; CONTRIBUTING Windows setup and desktop build

This commit is contained in:
CRTkafa 2026-10-21 22:26:30 +08:00
parent 0ac3cd02b0
commit 46f3e56c09
3 changed files with 25 additions and 6 deletions

View file

@ -9,7 +9,7 @@
// tests/desktop-dist.test.ts.
import { existsSync, readdirSync } from 'node:fs';
import { homedir } from 'node:os';
import { join } from 'node:path';
import { join, posix } from 'node:path';
export const BUNDLE_ID = 'dev.storebound.desktop';
export const PAGE = 'https://storebound.dev/#download';
@ -101,9 +101,9 @@ export function findInstalled(platform: NodeJS.Platform, env: Record<string, str
// the release acceptance matrix drives the install prompt on a machine that has the app: act as if it had none
if (env.STOREBOUND_DESKTOP_APP === 'none') return null;
if (platform === 'darwin') {
for (const dir of ['/Applications', join(home, 'Applications')]) {
const app = join(dir, 'storebound.app');
if (exists(join(app, 'Contents/MacOS/storebound-desktop'))) return { path: app, how: 'bundle' };
for (const dir of ['/Applications', posix.join(home, 'Applications')]) {
const app = posix.join(dir, 'storebound.app');
if (exists(posix.join(app, 'Contents/MacOS/storebound-desktop'))) return { path: app, how: 'bundle' };
}
return null;
}
@ -118,9 +118,9 @@ export function findInstalled(platform: NodeJS.Platform, env: Record<string, str
}
if (exists('/usr/bin/storebound-desktop')) return { path: '/usr/bin/storebound-desktop', how: 'deb' };
// an AppImage is wherever its owner put it: look in the usual folders (storebound_0.1.0_amd64.AppImage, renamed ones)
for (const dir of [join(home, 'Applications'), join(home, '.local/bin'), join(home, 'Downloads')]) {
for (const dir of [posix.join(home, 'Applications'), posix.join(home, '.local/bin'), posix.join(home, 'Downloads')]) {
const name = list(dir).filter(n => /^storebound(?:[-_][A-Za-z0-9._-]*)?\.AppImage$/i.test(n)).sort().at(-1);
if (name) return { path: join(dir, name), how: 'appimage' };
if (name) return { path: posix.join(dir, name), how: 'appimage' };
}
return null;
}