aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-08 18:53:58 +0000
committerGitHub <[email protected]>2020-12-08 18:53:58 +0000
commit9145b973c9a65614d0c6b6432021d402fa4abded (patch)
treebcf9bfd2ff5dc0b8fb8d2476e6d4a849c01269ee /xtask
parent70fa57f8d30c80927465de9a1b8501d7a2ee4925 (diff)
parent7cf2c0d46ffc68ccc08e50866df0a0e92de4ff1c (diff)
Merge #6766
6766: Add client install support for `code-exploration` builds. r=lnicola a=derdaele VSCode has a feature to install the command to the PATH. <img width="640" alt="Capture d’écran 2020-12-08 à 19 25 43" src="https://user-images.githubusercontent.com/16373039/101525141-2e013300-398b-11eb-8d07-60a92ae9587c.png"> `code-exploration` is the command name for the ARM64 experimental build. As of today, this is the only build running natively on Apple Silicon. See _ARM64_ Experimental in https://code.visualstudio.com/insiders/#osx. The `-exploration` prefix seems pretty undocumented, my understanding of it is that it is an insider-like version that uses a different electron version (in this case, maybe the election version that was recently ported to Apple Silicon?). Co-authored-by: Jérémy <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/install.rs20
1 files changed, 14 insertions, 6 deletions
diff --git a/xtask/src/install.rs b/xtask/src/install.rs
index 78a8af797..12962bcfa 100644
--- a/xtask/src/install.rs
+++ b/xtask/src/install.rs
@@ -16,6 +16,7 @@ pub struct InstallCmd {
16#[derive(Clone, Copy)] 16#[derive(Clone, Copy)]
17pub enum ClientOpt { 17pub enum ClientOpt {
18 VsCode, 18 VsCode,
19 VsCodeExploration,
19 VsCodeInsiders, 20 VsCodeInsiders,
20 VsCodium, 21 VsCodium,
21 VsCodeOss, 22 VsCodeOss,
@@ -26,10 +27,11 @@ impl ClientOpt {
26 pub const fn as_cmds(&self) -> &'static [&'static str] { 27 pub const fn as_cmds(&self) -> &'static [&'static str] {
27 match self { 28 match self {
28 ClientOpt::VsCode => &["code"], 29 ClientOpt::VsCode => &["code"],
30 ClientOpt::VsCodeExploration => &["code-exploration"],
29 ClientOpt::VsCodeInsiders => &["code-insiders"], 31 ClientOpt::VsCodeInsiders => &["code-insiders"],
30 ClientOpt::VsCodium => &["codium"], 32 ClientOpt::VsCodium => &["codium"],
31 ClientOpt::VsCodeOss => &["code-oss"], 33 ClientOpt::VsCodeOss => &["code-oss"],
32 ClientOpt::Any => &["code", "code-insiders", "codium", "code-oss"], 34 ClientOpt::Any => &["code", "code-exploration", "code-insiders", "codium", "code-oss"],
33 } 35 }
34 } 36 }
35} 37}
@@ -44,11 +46,17 @@ impl std::str::FromStr for ClientOpt {
44 type Err = anyhow::Error; 46 type Err = anyhow::Error;
45 47
46 fn from_str(s: &str) -> Result<Self, Self::Err> { 48 fn from_str(s: &str) -> Result<Self, Self::Err> {
47 [ClientOpt::VsCode, ClientOpt::VsCodeInsiders, ClientOpt::VsCodium, ClientOpt::VsCodeOss] 49 [
48 .iter() 50 ClientOpt::VsCode,
49 .copied() 51 ClientOpt::VsCodeExploration,
50 .find(|c| [s] == c.as_cmds()) 52 ClientOpt::VsCodeInsiders,
51 .ok_or_else(|| anyhow::format_err!("no such client")) 53 ClientOpt::VsCodium,
54 ClientOpt::VsCodeOss,
55 ]
56 .iter()
57 .copied()
58 .find(|c| [s] == c.as_cmds())
59 .ok_or_else(|| anyhow::format_err!("no such client"))
52 } 60 }
53} 61}
54 62