feat(rustup): add rustup.channels config (#1206)
This commit is contained in:
@@ -376,3 +376,8 @@
|
|||||||
# during the pixi step
|
# during the pixi step
|
||||||
# (default: false)
|
# (default: false)
|
||||||
# include_release_notes = false
|
# include_release_notes = false
|
||||||
|
|
||||||
|
[rustup]
|
||||||
|
# If set, updates only these channels.
|
||||||
|
# (default: [] (all channels))
|
||||||
|
# channels = ["stable"]
|
||||||
|
|||||||
@@ -389,6 +389,12 @@ pub struct VscodeConfig {
|
|||||||
profile: Option<String>,
|
profile: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Default, Debug, Merge)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
|
pub struct Rustup {
|
||||||
|
channels: Option<Vec<String>>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default, Debug, Merge)]
|
#[derive(Deserialize, Default, Debug, Merge)]
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
/// Configuration file
|
/// Configuration file
|
||||||
@@ -473,6 +479,9 @@ pub struct ConfigFile {
|
|||||||
|
|
||||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||||
vscode: Option<VscodeConfig>,
|
vscode: Option<VscodeConfig>,
|
||||||
|
|
||||||
|
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||||
|
rustup: Option<Rustup>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn config_directory() -> PathBuf {
|
fn config_directory() -> PathBuf {
|
||||||
@@ -1493,6 +1502,14 @@ impl Config {
|
|||||||
.unwrap_or(true)
|
.unwrap_or(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn rustup_channels(&self) -> Vec<String> {
|
||||||
|
self.config_file
|
||||||
|
.rustup
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|rustup| rustup.channels.clone())
|
||||||
|
.unwrap_or_default()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn verbose(&self) -> bool {
|
pub fn verbose(&self) -> bool {
|
||||||
self.opt.verbose
|
self.opt.verbose
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,11 @@ pub fn run_rustup(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
let rustup = require("rustup")?;
|
let rustup = require("rustup")?;
|
||||||
|
|
||||||
print_separator("rustup");
|
print_separator("rustup");
|
||||||
ctx.execute(rustup).arg("update").status_checked()
|
|
||||||
|
ctx.execute(rustup)
|
||||||
|
.arg("update")
|
||||||
|
.args(ctx.config().rustup_channels())
|
||||||
|
.status_checked()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_rye(ctx: &ExecutionContext) -> Result<()> {
|
pub fn run_rye(ctx: &ExecutionContext) -> Result<()> {
|
||||||
|
|||||||
Reference in New Issue
Block a user