From 30ea7e35080687d0cb4d917067728ca4e8a29dd7 Mon Sep 17 00:00:00 2001 From: efroemling Date: Sun, 20 Oct 2019 16:07:27 -0700 Subject: [PATCH] A few tool fixes for running under WSL --- tools/snippets | 16 +++++++++++----- tools/stage_assets | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/snippets b/tools/snippets index 57d13431..46ab8870 100755 --- a/tools/snippets +++ b/tools/snippets @@ -646,17 +646,23 @@ def make_prefab() -> None: system = platform.system() machine = platform.machine() + if system == 'Darwin': # Currently there's just x86_64 on mac; will need to revisit when arm # cpus happen. base = 'mac' elif system == 'Linux': - # We currently only support x86_64 linux. - if machine == 'x86_64': - base = 'linux' + # If it looks like we're in Windows Subsystem for Linux, + # go with the Windows version. + if 'microsoft' in platform.uname()[3].lower(): + base = 'windows' else: - raise RuntimeError(f'make_prefab: unsupported linux machine type:' - f' {machine}.') + # We currently only support x86_64 linux. + if machine == 'x86_64': + base = 'linux' + else: + raise RuntimeError(f'make_prefab: unsupported linux machine type:' + f' {machine}.') else: raise RuntimeError(f'make_prefab: unrecognized platform:' f' {platform.system()}.') diff --git a/tools/stage_assets b/tools/stage_assets index 356e784f..27816237 100755 --- a/tools/stage_assets +++ b/tools/stage_assets @@ -250,7 +250,8 @@ def _sync_windows_extras(cfg: Config) -> str: _run(cmd) # Now sync the top level individual files. - cmd = ("rsync --update " + cfg.win_extras_src + "/{*.dll,*.exe}" + cmd = ("rsync --update " + cfg.win_extras_src + "/*.dll " + + cfg.win_extras_src + "/*.exe" " \"" + cfg.dst + "/\"") _run(cmd)