Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44b67fc

Browse files
committed
only run xhost on Linux platforms
1 parent 3b8c700 commit 44b67fc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cmd/container.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ module.exports = class ContainerCommands extends CLICommandBase {
4848

4949
// provide access to the X server to Docker
5050
try {
51-
await execa('xhost', ['+local:root']);
52-
await execa('xhost', ['+local:particle']);
53-
await execa('xhost', ['+SI:localuser:root']);
51+
if (os.platform() === 'linux') {
52+
await execa('xhost', ['+local:root']);
53+
await execa('xhost', ['+local:particle']);
54+
await execa('xhost', ['+SI:localuser:root']);
55+
}
5456
} catch {
5557
// ignore errors on non-Linux systems
5658
}

0 commit comments

Comments
 (0)