feat: allow version specification for deno (#970)
* feat: allow version specification for deno * fix: missing quotes for string in toml file Co-authored-by: SteveLauC <stevelauc@outlook.com> * fix: deno upgrade for different executable versions * fix: tell apart the two cases for v1.x in SkipStep reason * docs: add comments and documentation on version method for deno * chore: add explanatory comment on stable channel that does nothing Co-authored-by: SteveLauC <stevelauc@outlook.com> --------- Co-authored-by: SteveLauC <stevelauc@outlook.com>
This commit is contained in:
@@ -255,6 +255,13 @@ pub struct NPM {
|
||||
use_sudo: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Merge)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
pub struct Deno {
|
||||
version: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Merge)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
@@ -491,6 +498,9 @@ pub struct ConfigFile {
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
yarn: Option<Yarn>,
|
||||
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
deno: Option<Deno>,
|
||||
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
vim: Option<Vim>,
|
||||
|
||||
@@ -1526,6 +1536,10 @@ impl Config {
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn deno_version(&self) -> Option<&str> {
|
||||
self.config_file.deno.as_ref().and_then(|deno| deno.version.as_deref())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn firmware_upgrade(&self) -> bool {
|
||||
self.config_file
|
||||
|
||||
Reference in New Issue
Block a user