| ... | ... | @@ -206,7 +206,9 @@ it.effect("reveals a file in File Explorer through PowerShell on Windows", () => |
| 206 | 206 | const launcher = yield* ExternalLauncher.ExternalLauncher; |
| 207 | 207 | yield* launcher.launchEditor({ |
| 208 | 208 | editor: "file-manager", |
| 209 | | cwd: "C:\\workspace with spaces\\media\\author's clip.mp4", |
| 209 | // Web file links normalize separators even when the server runs on |
| 210 | // Windows. Explorer's `/select` switch requires Windows separators. |
| 211 | cwd: "C:/workspace with spaces/media/author's clip.mp4", |
| 210 | 212 | reveal: true, |
| 211 | 213 | }); |
| 212 | 214 | return yield* launcher.resolveFileManagerRevealKind(); |
| ... | ... | @@ -261,8 +263,12 @@ it.skipIf(process.platform !== "win32")( |
| 261 | 263 | const outputPath = NodePath.join(tempDir, "argv.txt"); |
| 262 | 264 | NodeFS.writeFileSync(recorderPath, `@echo off\r\n>"${outputPath}" echo(%*\r\n`); |
| 263 | 265 | |
| 264 | | const target = "C:\\workspace with spaces\\media\\author's clip.mp4"; |
| 265 | | const source = ExternalLauncher.buildFileExplorerRevealPowerShellSource(recorderPath, target); |
| 266 | const target = "C:/workspace with spaces/media/author's clip.mp4"; |
| 267 | const explorerTarget = target.replaceAll("/", "\\"); |
| 268 | const source = ExternalLauncher.buildFileExplorerRevealPowerShellSource( |
| 269 | recorderPath, |
| 270 | explorerTarget, |
| 271 | ); |
| 266 | 272 | const powerShellPath = `${process.env.SYSTEMROOT ?? "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`; |
| 267 | 273 | NodeChildProcess.execFileSync( |
| 268 | 274 | powerShellPath, |
| ... | ... | @@ -290,7 +296,7 @@ it.skipIf(process.platform !== "win32")( |
| 290 | 296 | } |
| 291 | 297 | await sleep(200); |
| 292 | 298 | const recorded = NodeFS.readFileSync(outputPath, "utf8").trim(); |
| 293 | | assert.equal(recorded, `/select,"${target}"`); |
| 299 | assert.equal(recorded, `/select,"${explorerTarget}"`); |
| 294 | 300 | } finally { |
| 295 | 301 | NodeFS.rmSync(tempDir, { recursive: true, force: true }); |
| 296 | 302 | } |