Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On clean update binary proxies #72

Merged
merged 8 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ All notable changes to this project will be documented in this file.

- Release instructions to README.

### Fixed

- Running Clean command now also updates the binary proxies automatically.
amanjeev marked this conversation as resolved.
Show resolved Hide resolved

## [1.2.0] - 2024-11-25

### Changed
Expand Down
3 changes: 3 additions & 0 deletions crates/criticalup-cli/src/commands/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use std::path::{Path, PathBuf};
use tokio::fs;

use criticalup_core::binary_proxies;
use criticalup_core::project_manifest::InstallationId;
use criticalup_core::state::State;

Expand All @@ -16,6 +17,8 @@ pub(crate) async fn run(ctx: &Context) -> Result<(), Error> {

delete_cache_directory(&ctx.config.paths.cache_dir).await?;
delete_unused_installations(installations_dir, &state).await?;
// Deletes unused binary proxies after state cleanup.
amanjeev marked this conversation as resolved.
Show resolved Hide resolved
binary_proxies::update(&ctx.config, &state, &std::env::current_exe()?).await?;
delete_untracked_installation_dirs(installations_dir, state).await?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/criticalup-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ enum Commands {
offline: bool,
},

/// Delete all unused and untracked installations
/// Delete cache and unused installations
Clean,

/// Run a command for a given toolchain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/criticalup-cli/tests/cli/clean.rs
expression: repr
snapshot_kind: text
---
exit: exit status: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
source: crates/criticalup-cli/tests/cli/clean.rs
expression: repr
snapshot_kind: text
---
exit: exit status: 0

empty stdout

stderr
------
Delete all unused and untracked installations
Delete cache and unused installations

Usage:
criticalup-test clean [OPTIONS]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/criticalup-cli/tests/cli/root.rs
expression: repr
snapshot_kind: text
---
exit: exit status: 1

Expand All @@ -16,7 +17,7 @@ Usage:
Commands:
auth Show and change authentication with the download server
install Install the toolchain for the given project based on the manifest `criticalup.toml`
clean Delete all unused and untracked installations
clean Delete cache and unused installations
run Run a command for a given toolchain
remove Delete all the products specified in the manifest `criticalup.toml`
verify Verify a given toolchain
Expand Down
Loading