Skip to content

Commit

Permalink
Merge branch 'main' into tui
Browse files Browse the repository at this point in the history
  • Loading branch information
adamperkowski committed Dec 4, 2024
2 parents 6703b4a + a8a42fd commit 20babdd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Test lib & docs
- name: Test
run: |
cargo test --lib --all-features
cargo test --doc --all-features
cargo test --all-features --no-fail-fast
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ pub async fn save(config_content: Config, path: PathBuf) -> error::Result<()> {
let mut file = fs::File::create(path).await?;
let content = format!("{}\n", toml::to_string(&config_content)?);
file.write_all(content.as_bytes()).await?;
file.shutdown().await?;

Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async fn compare(core: Core) -> error::Result<()> {
"*".white().on_black(),
new_pkg.0.blue(),
old_pkg.1.version.red(),
new_pkg.1.version.blue()
new_pkg.1.version.green()
);
}
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/verfiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ pub async fn save(
let content = format!("{}\n", serde_json::to_string_pretty(&verfile)?);

file.write_all(content.as_bytes()).await?;
file.shutdown().await?;

Ok(())
}

async fn load_file(path: &Path) -> error::Result<Verfile> {
if !path.exists() {
let mut file = fs::File::create(path).await?;
file.write_all(TEMPLATE.as_bytes()).await?;
file.shutdown().await?;
}

let content = fs::read_to_string(path).await?;
Expand Down

0 comments on commit 20babdd

Please sign in to comment.