Skip to content

Commit

Permalink
Merge pull request #425 from moonbitlang/moon_upgrade
Browse files Browse the repository at this point in the history
fix moon upgrade missing binary
  • Loading branch information
Young-Flash authored Oct 29, 2024
2 parents 2c58176 + 1455a05 commit c92bada
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/moonbuild/src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ pub fn do_upgrade(root: &'static str) -> Result<i32> {
let rt = tokio::runtime::Runtime::new()?;
rt.block_on(async {
let items = [
"moonbit.h",
"moonbit-fundamental.h",
"libmoonbitrun.o",
"libtcc1.a",
"moon",
"moonc",
"moonfmt",
Expand All @@ -227,12 +231,13 @@ pub fn do_upgrade(root: &'static str) -> Result<i32> {
"moondoc",
"moon_cove_report",
"mooncake",
"core.zip",];
"core.zip",
];
let urls = items
.iter()
.map(|item| {
if *item != "core.zip" {
format!("{}/{}/{}{}", root, os_arch(), item, if os_arch() == "windows" { ".exe" } else { "" })
format!("{}/{}/{}{}", root, os_arch(), item, if os_arch() == "windows" && !item.contains(".") { ".exe" } else { "" })
} else {
format!("{}/{}", root, item)
}
Expand Down

0 comments on commit c92bada

Please sign in to comment.