From 7d1a5d2ddfbde1a306b33bf3a8f77b2d85bac5b2 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:26:41 +0200 Subject: [PATCH] zed-local: add --stable flag to zed-local (#10165) `--stable` makes all clients except for the first one use a stable version of Zed (hardcoded to `/Applications/Zed/Contents/MacOS/zed` for now). That should make testing cross-channel collab changes a bit easier. /cc @maxbrunsfeld @ConradIrwin Release Notes: - N/A --- script/zed-local | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/script/zed-local b/script/zed-local index 62b6685355..b8d588c687 100755 --- a/script/zed-local +++ b/script/zed-local @@ -14,6 +14,7 @@ OPTIONS --release Build Zed in release mode -2, -3, -4, ... Spawn multiple Zed instances, with their windows tiled. --top Arrange the Zed windows so they take up the top half of the screen. + --stable Use stable Zed release installed on local machine for all instances (except for the first one). `.trim(); const { spawn, execFileSync } = require("child_process"); @@ -29,6 +30,7 @@ const DIGIT_FLAG_REGEX = /^--?(\d+)$/; let instanceCount = 1; let isReleaseMode = false; let isTop = false; +let othersOnStable = false; const args = process.argv.slice(2); while (args.length > 0) { @@ -44,6 +46,8 @@ while (args.length > 0) { } else if (arg === "--help") { console.log(HELP); process.exit(0); + } else if (arg === "--stable") { + othersOnStable = true; } else { break; } @@ -123,8 +127,11 @@ setTimeout(() => { row * instanceHeight + titleBarHeight, ].join(","); const size = [instanceWidth, instanceHeight].join(","); - - spawn(zedBinary, i == 0 ? args : [], { + let binaryPath = zedBinary; + if (i != 0 && othersOnStable) { + binaryPath = "/Applications/Zed.app/Contents/MacOS/zed"; + } + spawn(binaryPath, i == 0 ? args : [], { stdio: "inherit", env: { ZED_IMPERSONATE: users[i],