Skip to content

Commit c36c40e

Browse files
Fix windows binary resolution (#26)
1 parent d4fae67 commit c36c40e

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/Tools/TypescriptBinaryFactory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ public static function getBinaryNameFromServerSpecs(
8080
}
8181

8282
if (str_contains($os, 'win')) {
83-
if ('x86_64' === $machine) {
84-
return 'swc-win32-x64-msvc';
83+
if ('x86_64' === $machine || 'amd64' === $machine) {
84+
return 'swc-win32-x64-msvc.exe';
8585
}
86-
if ('amd64' === $machine) {
87-
return 'swc-win32-arm64-msvc';
86+
if ('arm64' === $machine) {
87+
return 'swc-win32-arm64-msvc.exe';
8888
}
8989
if ('i586' === $machine) {
90-
return 'swc-win32-ia32-msvc';
90+
return 'swc-win32-ia32-msvc.exe';
9191
}
9292

9393
throw new \Exception(sprintf('No matching machine found for Windows platform (Machine: %s).', $machine));

tests/Tools/TypeScriptBinaryFactoryTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ public function provideServerSpecs()
6666
['Linux', 'x86_64', 'linux-musl', 'swc-linux-x64-musl'],
6767
['Linux', 'arm64', 'linux-musl', 'swc-linux-arm64-musl'],
6868

69-
['Windows', 'x86_64', 'windows', 'swc-win32-x64-msvc'],
70-
['Windows', 'amd64', 'windows', 'swc-win32-arm64-msvc'],
71-
['Windows', 'i586', 'windows', 'swc-win32-ia32-msvc'],
69+
['Windows', 'x86_64', 'windows', 'swc-win32-x64-msvc.exe'],
70+
['Windows', 'amd64', 'windows', 'swc-win32-x64-msvc.exe'],
71+
['Windows', 'arm64', 'windows', 'swc-win32-arm64-msvc.exe'],
72+
['Windows', 'i586', 'windows', 'swc-win32-ia32-msvc.exe'],
7273

7374
['Undefined', 'x86_64', 'darwin', null, \Exception::class],
7475
['Darwin', 'undefined', 'darwin', null, \Exception::class],

tests/fixtures/bin/watchexec-1.20.5-x86_64-unknown-linux-gnu/watchexec

Whitespace-only changes.

0 commit comments

Comments
 (0)