mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
Merge pull request #812 from betrusted-io/fix-toolchain
make toolchain matching more strict
This commit is contained in:
commit
155c71113e
1 changed files with 21 additions and 7 deletions
|
|
@ -270,16 +270,30 @@ pub(crate) fn ensure_compiler(
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let first_asset = match assets.first() {
|
// Find the asset that matches the target architecture
|
||||||
None => continue,
|
let matching_asset = assets.iter().find(|asset| {
|
||||||
Some(s) => s,
|
asset
|
||||||
};
|
.get("name")
|
||||||
|
.and_then(|n| n.as_str())
|
||||||
|
.map(|name| {
|
||||||
|
// Extract the toolchain prefix (everything before the version number)
|
||||||
|
if let Some(toolchain_prefix) = name.split('_').next() {
|
||||||
|
target.starts_with(toolchain_prefix)
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.unwrap_or(false)
|
||||||
|
});
|
||||||
|
|
||||||
let download_url = match first_asset.get("browser_download_url") {
|
let download_url = match matching_asset {
|
||||||
None => continue,
|
None => continue,
|
||||||
Some(s) => match s.as_str() {
|
Some(asset) => match asset.get("browser_download_url") {
|
||||||
None => continue,
|
None => continue,
|
||||||
Some(s) => s,
|
Some(s) => match s.as_str() {
|
||||||
|
None => continue,
|
||||||
|
Some(s) => s,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
// println!("Candidate Release: {}", download_url);
|
// println!("Candidate Release: {}", download_url);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue