mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
feat: add --arch flag to start-cli registry package download
Use the new flag in the image build recipe to download the tor s9pk for the target architecture, replacing the standalone download script.
This commit is contained in:
@@ -418,6 +418,9 @@ pub struct CliDownloadParams {
|
||||
pub target_version: Option<VersionRange>,
|
||||
#[arg(short, long, help = "help.arg.destination-path")]
|
||||
pub dest: Option<PathBuf>,
|
||||
#[arg(long, short, help = "help.arg.architecture")]
|
||||
#[ts(type = "string | null")]
|
||||
pub arch: Option<InternedString>,
|
||||
}
|
||||
|
||||
pub async fn cli_download(
|
||||
@@ -426,6 +429,7 @@ pub async fn cli_download(
|
||||
ref id,
|
||||
target_version,
|
||||
dest,
|
||||
arch,
|
||||
}: CliDownloadParams,
|
||||
) -> Result<(), Error> {
|
||||
let progress_tracker = FullProgressTracker::new();
|
||||
@@ -473,6 +477,13 @@ pub async fn cli_download(
|
||||
res.best.remove(version).unwrap()
|
||||
}
|
||||
};
|
||||
if let Some(arch) = &arch {
|
||||
s9pk.retain(|(hw, _)| {
|
||||
hw.arch
|
||||
.as_ref()
|
||||
.map_or(true, |arches| arches.contains(arch))
|
||||
});
|
||||
}
|
||||
let s9pk = match s9pk.len() {
|
||||
0 => {
|
||||
return Err(Error::new(
|
||||
|
||||
Reference in New Issue
Block a user