Skip to content

Commit 14bfc9d

Browse files
fix: dispatch touch command to the emulator on Windows with Docker (#449)
Signed-off-by: David Dal Busco <[email protected]>
1 parent 9de3e55 commit 14bfc9d

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/services/functions/build/touch.services.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ export const dispatchEmulatorTouchSputnik = async () => {
1212
};
1313

1414
/**
15-
* Workaround Podman and Apple container issues on macOS:
15+
* Workaround:
16+
*
17+
* 1. Podman and Apple container issues on macOS:
1618
* - https://github.com/containers/podman/issues/22343
1719
* - https://github.com/apple/container/issues/141
20+
*
21+
* 2. According to our debugging with developers, a similar issue arises with Docker on Windows.
1822
*/
1923
const dispatchTouch = async ({filename}: {filename: string}) => {
20-
if (process.platform !== 'darwin') {
21-
// Workaround only required on macOS. Not sure if it's required on old Intel process, maybe not but
22-
// for simplicity reasons let's consider all Apple devices require the workaround.
24+
if (!['darwin', 'win32'].includes(process.platform)) {
25+
// Workaround required on macOS with Podman and Windows with Docker.
26+
// Not sure if required on Intel-based Macs, but for simplicity we apply it to all macOS devices.
2327
return;
2428
}
2529

@@ -35,8 +39,13 @@ const dispatchTouch = async ({filename}: {filename: string}) => {
3539
}
3640
} = parsedResult;
3741

38-
if (runner === 'docker') {
39-
// No need of the workaround for Docker
42+
// No need of the workaround for Docker on macOS
43+
if (process.platform === 'darwin' && runner === 'docker') {
44+
return;
45+
}
46+
47+
// We did not test this use case therefore we assume it works (no reports so far)
48+
if (process.platform === 'win32' && runner === 'podman') {
4049
return;
4150
}
4251

0 commit comments

Comments
 (0)