chore: pull more strings from the product.json (#166769)

Fixes the bulk of https://github.com/microsoft/vscode-cli/issues/560
This commit is contained in:
Connor Peet
2022-11-18 18:52:52 -08:00
committed by GitHub
parent 384ba2454f
commit 796ee2bf3c
25 changed files with 229 additions and 116 deletions

View File

@@ -5,6 +5,7 @@
use std::cmp::Ordering;
use super::command::capture_command;
use crate::constants::QUALITYLESS_SERVER_NAME;
use crate::update_service::Platform;
use crate::util::errors::SetupError;
use lazy_static::lazy_static;
@@ -41,8 +42,13 @@ impl PreReqChecker {
#[cfg(not(target_os = "linux"))]
pub async fn verify(&self) -> Result<Platform, AnyError> {
use crate::constants::QUALITYLESS_PRODUCT_NAME;
Platform::env_default().ok_or_else(|| {
SetupError("VS Code is not supported on this platform".to_owned()).into()
SetupError(format!(
"{} is not supported on this platform",
QUALITYLESS_PRODUCT_NAME
))
.into()
})
}
@@ -91,8 +97,8 @@ impl PreReqChecker {
.join("\n");
Err(AnyError::from(SetupError(format!(
"This machine not meet VS Code Server's prerequisites, expected either...\n{}",
bullets,
"This machine not meet {}'s prerequisites, expected either...\n{}",
QUALITYLESS_SERVER_NAME, bullets,
))))
}
}
@@ -107,8 +113,8 @@ async fn check_musl_interpreter() -> Result<(), String> {
if fs::metadata(MUSL_PATH).await.is_err() {
return Err(format!(
"find {}, which is required to run the VS Code Server in musl environments",
MUSL_PATH
"find {}, which is required to run the {} in musl environments",
MUSL_PATH, QUALITYLESS_SERVER_NAME
));
}