fix(ci): normalize Windows shortcut paths for cross-platform tests

This commit is contained in:
2026-03-28 00:00:49 -07:00
parent d5b746bd1d
commit 1408ad652a

View File

@@ -24,7 +24,7 @@ export interface WindowsMpvShortcutInstallResult {
} }
export function resolveWindowsStartMenuProgramsDir(appDataDir: string): string { export function resolveWindowsStartMenuProgramsDir(appDataDir: string): string {
return path.join(appDataDir, 'Microsoft', 'Windows', 'Start Menu', 'Programs'); return path.win32.join(appDataDir, 'Microsoft', 'Windows', 'Start Menu', 'Programs');
} }
export function resolveWindowsMpvShortcutPaths(options: { export function resolveWindowsMpvShortcutPaths(options: {
@@ -32,11 +32,11 @@ export function resolveWindowsMpvShortcutPaths(options: {
desktopDir: string; desktopDir: string;
}): WindowsMpvShortcutPaths { }): WindowsMpvShortcutPaths {
return { return {
startMenuPath: path.join( startMenuPath: path.win32.join(
resolveWindowsStartMenuProgramsDir(options.appDataDir), resolveWindowsStartMenuProgramsDir(options.appDataDir),
WINDOWS_MPV_SHORTCUT_NAME, WINDOWS_MPV_SHORTCUT_NAME,
), ),
desktopPath: path.join(options.desktopDir, WINDOWS_MPV_SHORTCUT_NAME), desktopPath: path.win32.join(options.desktopDir, WINDOWS_MPV_SHORTCUT_NAME),
}; };
} }
@@ -54,7 +54,7 @@ export function buildWindowsMpvShortcutDetails(exePath: string): WindowsShortcut
return { return {
target: exePath, target: exePath,
args: '--launch-mpv', args: '--launch-mpv',
cwd: path.dirname(exePath), cwd: path.win32.dirname(exePath),
description: 'Launch mpv with the SubMiner profile', description: 'Launch mpv with the SubMiner profile',
icon: exePath, icon: exePath,
iconIndex: 0, iconIndex: 0,
@@ -79,7 +79,7 @@ export function applyWindowsMpvShortcuts(options: {
const failures: string[] = []; const failures: string[] = [];
const ensureShortcut = (shortcutPath: string): void => { const ensureShortcut = (shortcutPath: string): void => {
mkdirSync(path.dirname(shortcutPath), { recursive: true }); mkdirSync(path.win32.dirname(shortcutPath), { recursive: true });
const ok = options.writeShortcutLink(shortcutPath, 'replace', details); const ok = options.writeShortcutLink(shortcutPath, 'replace', details);
if (!ok) { if (!ok) {
failures.push(shortcutPath); failures.push(shortcutPath);