Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Dec 6, 2024
1 parent 69f674d commit 14205ce
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions repos.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
https://github.com/moonbitlang/core main
https://github.com/moonbitlang/x main
# generated list to test mooncakes on mooncakes.io
A-23187/encoding 0.1.0
CAIMEOX/feat-moon 0.2.0
CAIMEOX/list 0.1.0
30 changes: 15 additions & 15 deletions src/auto_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ use crate::mooncakesio::get_all_mooncakes;

#[test]
fn gen_latest_list_with_version() {
let repos = std::fs::read_to_string("repos.txt").unwrap();
let parts: Vec<&str> = repos
.splitn(2, "# generated list to test mooncakes on mooncakes.io")
.collect();
// let repos = std::fs::read_to_string("repos.txt").unwrap();
// let parts: Vec<&str> = repos
// .splitn(2, "# generated list to test mooncakes on mooncakes.io")
// .collect();

let mut mooncakesio = String::new();
let db = get_all_mooncakes().unwrap();
for (name, versions) in db.db {
let latest_version = versions.last().unwrap();
mooncakesio.push_str(&format!("{} {}\n", name, latest_version));
}
// let mut mooncakesio = String::new();
// let db = get_all_mooncakes().unwrap();
// for (name, versions) in db.db {
// let latest_version = versions.last().unwrap();
// mooncakesio.push_str(&format!("{} {}\n", name, latest_version));
// }

let updated = format!(
"{}# generated list to test mooncakes on mooncakes.io\n{}",
parts[0], mooncakesio
);
std::fs::write("repos.txt", updated).unwrap();
// let updated = format!(
// "{}# generated list to test mooncakes on mooncakes.io\n{}",
// parts[0], mooncakesio
// );
// std::fs::write("repos.txt", updated).unwrap();
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ fn main0() -> anyhow::Result<()> {
#[cfg(target_os = "linux")]
let os = "linux";
#[cfg(target_os = "macos")]
let os = "macos";
let os = "mac";
match res {
Ok(dashboard) => {
let date = Local::now().format("%Y-%m-%d");
Expand Down

0 comments on commit 14205ce

Please sign in to comment.