Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

Update ShellProgramNotFound error diagnostics format and snapshots

+55 -43
+37 -34
compiler-core/src/error.rs
··· 1052 1052 } 1053 1053 1054 1054 Error::ShellProgramNotFound { program , os } => { 1055 - let mut text = format!("The program `{program}` was not found. Is it installed?\n"); 1055 + let mut text = format!("The program `{program}` was not found. Is it installed?"); 1056 + 1057 + match os { 1058 + OS::MacOS => { 1059 + fn brew_install(name: &str, pkg: &str) -> String { 1060 + format!("\n\nYou can install {} via homebrew: brew install {}", name, pkg) 1061 + } 1062 + match program.as_str() { 1063 + "erl" | "erlc" | "escript" => text.push_str(&brew_install("Erlang", "erlang")), 1064 + "rebar3" => text.push_str(&brew_install("Rebar3", "rebar3")), 1065 + "deno" => text.push_str(&brew_install("Deno", "deno")), 1066 + "elixir" => text.push_str(&brew_install("Elixir", "elixir")), 1067 + "node" => text.push_str(&brew_install("Node.js", "node")), 1068 + "bun" => text.push_str(&brew_install("Bun", "oven-sh/bun/bun")), 1069 + "git" => text.push_str(&brew_install("Git", "git")), 1070 + _ => (), 1071 + } 1072 + } 1073 + OS::Linux(distro) => { 1074 + fn apt_install(name: &str, pkg: &str) -> String { 1075 + format!("\n\nYou can install {} via apt: sudo apt install {}", name, pkg) 1076 + } 1077 + match distro { 1078 + Distro::Ubuntu | Distro::Debian => { 1079 + match program.as_str() { 1080 + "elixir" => text.push_str(&apt_install("Elixir", "elixir")), 1081 + "git" => text.push_str(&apt_install("Git", "git")), 1082 + _ => (), 1083 + } 1084 + } 1085 + Distro::Other => (), 1086 + } 1087 + } 1088 + _ => (), 1089 + } 1090 + 1091 + text.push('\n'); 1056 1092 1057 1093 match program.as_str() { 1058 1094 "erl" | "erlc" | "escript" => text.push_str( ··· 1090 1126 Documentation for installing Git can be viewed here: 1091 1127 https://git-scm.com/book/en/v2/Getting-Started-Installing-Git", 1092 1128 ), 1093 - _ => (), 1094 - } 1095 - match os { 1096 - OS::MacOS => { 1097 - fn brew_install(program: &str) -> String { 1098 - format!("\nYou can install {} via homebrew: brew install {}", program, program) 1099 - } 1100 - match program.as_str() { 1101 - "erl" | "erlc" | "escript" => text.push_str(&brew_install("erlang")), 1102 - "rebar3" => text.push_str(&brew_install("rebar3")), 1103 - "deno" => text.push_str(&brew_install("deno")), 1104 - "elixir" => text.push_str(&brew_install("elixir")), 1105 - "node" => text.push_str(&brew_install("node")), 1106 - "bun" => text.push_str(&brew_install("oven-sh/bun/bun")), 1107 - "git" => text.push_str(&brew_install("git")), 1108 - _ => (), 1109 - } 1110 - } 1111 - OS::Linux(distro) => { 1112 - fn apt_install(program: &str) -> String { 1113 - format!("\nYou can install {} via apt: sudo apt install {}", program, program) 1114 - } 1115 - match distro { 1116 - Distro::Ubuntu | Distro::Debian => { 1117 - match program.as_str() { 1118 - "elixir" => text.push_str(&apt_install("elixir")), 1119 - "git" => text.push_str(&apt_install("git")), 1120 - _ => (), 1121 - } 1122 - } 1123 - Distro::Other => (), 1124 - } 1125 - } 1126 1129 _ => (), 1127 1130 } 1128 1131
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_bun_macos_other.snap
··· 4 4 --- 5 5 The program `bun` was not found. Is it installed? 6 6 7 + You can install Bun via homebrew: brew install oven-sh/bun/bun 8 + 7 9 Documentation for installing bun can be viewed here: 8 10 https://bun.sh/docs/installation/ 9 - You can install oven-sh/bun/bun via homebrew: brew install oven-sh/bun/bun
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_deno_macos_other.snap
··· 4 4 --- 5 5 The program `deno` was not found. Is it installed? 6 6 7 + You can install Deno via homebrew: brew install deno 8 + 7 9 Documentation for installing Deno can be viewed here: 8 10 https://docs.deno.com/runtime/getting_started/installation/ 9 - You can install deno via homebrew: brew install deno
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_elixir_linux_ubuntu.snap
··· 4 4 --- 5 5 The program `elixir` was not found. Is it installed? 6 6 7 + You can install Elixir via apt: sudo apt install elixir 8 + 7 9 Documentation for installing Elixir can be viewed here: 8 10 https://elixir-lang.org/install.html 9 - You can install elixir via apt: sudo apt install elixir
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_elixir_macos_other.snap
··· 4 4 --- 5 5 The program `elixir` was not found. Is it installed? 6 6 7 + You can install Elixir via homebrew: brew install elixir 8 + 7 9 Documentation for installing Elixir can be viewed here: 8 10 https://elixir-lang.org/install.html 9 - You can install elixir via homebrew: brew install elixir
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_erlc_macos_other.snap
··· 4 4 --- 5 5 The program `erlc` was not found. Is it installed? 6 6 7 + You can install Erlang via homebrew: brew install erlang 8 + 7 9 Documentation for installing Erlang can be viewed here: 8 10 https://gleam.run/getting-started/installing/ 9 - You can install erlang via homebrew: brew install erlang
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_git_linux_ubuntu.snap
··· 4 4 --- 5 5 The program `git` was not found. Is it installed? 6 6 7 + You can install Git via apt: sudo apt install git 8 + 7 9 Documentation for installing Git can be viewed here: 8 10 https://git-scm.com/book/en/v2/Getting-Started-Installing-Git 9 - You can install git via apt: sudo apt install git
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_git_macos_other.snap
··· 4 4 --- 5 5 The program `git` was not found. Is it installed? 6 6 7 + You can install Git via homebrew: brew install git 8 + 7 9 Documentation for installing Git can be viewed here: 8 10 https://git-scm.com/book/en/v2/Getting-Started-Installing-Git 9 - You can install git via homebrew: brew install git
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_node_macos_other.snap
··· 4 4 --- 5 5 The program `node` was not found. Is it installed? 6 6 7 + You can install Node.js via homebrew: brew install node 8 + 7 9 Documentation for installing Node.js via package manager can be viewed here: 8 10 https://nodejs.org/en/download/package-manager/all/ 9 - You can install node via homebrew: brew install node
+2 -1
compiler-core/src/error/snapshots/gleam_core__error__tests__shell_program_not_found_rebar3_macos_other.snap
··· 4 4 --- 5 5 The program `rebar3` was not found. Is it installed? 6 6 7 + You can install Rebar3 via homebrew: brew install rebar3 8 + 7 9 Documentation for installing rebar3 can be viewed here: 8 10 https://rebar3.org/docs/getting-started/ 9 - You can install rebar3 via homebrew: brew install rebar3