From d74d1269b2a9a27480d5fd8268455d5f7b0d8ee1 Mon Sep 17 00:00:00 2001 From: thinkgos Date: Tue, 30 Jan 2024 08:37:13 +0800 Subject: [PATCH] fix: fix doc and log --- README.md | 27 ++++++++++++++------------- goup-downloader/src/downloader.rs | 6 +----- goup-version/src/version.rs | 4 ++-- goup/src/command/mod.rs | 2 +- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index cbf6fe2..45b2fc9 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ I do not have Windows. So you know, welcome PR. ```shell $ goup install -Installing go1.21.6 ... -Unpacking /home/thinkgo/.goup/go1.21.6/go1.21.6.linux-amd64.tar.gz ... -Success: go1.21.6 installed in /home/thinkgo/.goup/go1.21.6 -Default Go is set to 'go1.21.6' +[2024-01-30T00:38:48Z INFO ] Installing go1.21.6 ... +[2024-01-30T00:38:48Z INFO ] Unpacking /home/thinkgo/.goup/go1.21.6/go1.21.6.linux-amd64.tar.gz ... +[2024-01-30T00:38:48Z INFO ] go1.21.6 installed in /home/thinkgo/.goup/go1.21.6 +[2024-01-30T00:38:48Z INFO ] Default Go is set to 'go1.21.6' $ goup list | VERSION | ACTIVE | |---------|--------| @@ -113,14 +113,14 @@ $ goup list ```bash $ goup install -Installing go1.21.6 ... -Unpacking /home/thinkgo/.goup/go1.21.6/go1.21.6.linux-amd64.tar.gz ... -Success: go1.21.6 installed in /home/thinkgo/.goup/go1.21.6 -Default Go is set to 'go1.21.6' +[2024-01-30T00:38:48Z INFO ] Installing go1.21.6 ... +[2024-01-30T00:38:48Z INFO ] Unpacking /home/thinkgo/.goup/go1.21.6/go1.21.6.linux-amd64.tar.gz ... +[2024-01-30T00:38:48Z INFO ] go1.21.6 installed in /home/thinkgo/.goup/go1.21.6 +[2024-01-30T00:38:48Z INFO ] Default Go is set to 'go1.21.6' $ goup install 1.21.4 --dry -Installing go1.21.4 ... -Unpacking /home/thinkgo/.goup/go1.21.4/go1.21.4.linux-amd64.tar.gz ... -Success: go1.21.6 installed in /home/thinkgo/.goup/go1.21.4 +[2024-01-30T00:38:48Z INFO ] Installing go1.21.4 ... +[2024-01-30T00:38:48Z INFO ] Unpacking /home/thinkgo/.goup/go1.21.4/go1.21.4.linux-amd64.tar.gz ... +[2024-01-30T00:38:48Z INFO ] go1.21.6 installed in /home/thinkgo/.goup/go1.21.4 ``` ### Switches to selected Go version @@ -133,7 +133,7 @@ $ goup use 1.21.5 ❯ 1.21.6 tip -Default Go is set to 'go1.21.6' +[2024-01-30T00:38:48Z INFO ] Default Go is set to 'go1.21.6' ``` ### Remove the specified Go version list @@ -156,7 +156,7 @@ $ goup upgrade Checking target-arch... x86_64-unknown-linux-gnu Checking current version... v0.3.0 Checking latest released version... v0.3.0 -Update status: `v0.3.0`! +[2024-01-30T00:38:48Z INFO ] Update status: `v0.3.0`! ``` ### Environment @@ -191,6 +191,7 @@ $ goup env - `goup search [FILTER]` lists all available Go versions. - `goup upgrade` upgrades `goup`. - `goup init` write all necessary environment variables and values to `$HOME/.goup/env`. +- `goup env` Show the specified goup environment variables and values. ## License diff --git a/goup-downloader/src/downloader.rs b/goup-downloader/src/downloader.rs index 43505d4..9cdd6cb 100644 --- a/goup-downloader/src/downloader.rs +++ b/goup-downloader/src/downloader.rs @@ -152,11 +152,7 @@ impl Downloader { .unpack(&version_dest_dir, &archive_file)?; // 设置解压成功 Dir::create_dot_unpacked_success_file(&home, version)?; - log::info!( - "Success: {} installed in {}", - version, - version_dest_dir.display() - ); + log::info!("{} installed in {}", version, version_dest_dir.display()); Ok(()) } diff --git a/goup-version/src/version.rs b/goup-version/src/version.rs index ee262d3..b29c612 100644 --- a/goup-version/src/version.rs +++ b/goup-version/src/version.rs @@ -144,7 +144,7 @@ impl Version { let version = Self::normalize(version); let cur = Self::current_go_version()?; if Some(&version) == cur.as_ref() { - log::warn!("{} is current active version, do not remove it", version); + log::warn!("{} is current active version, ignore deletion!", version); } else { let version_dir = Dir::from_home_dir()?.version(version); if version_dir.exists() { @@ -161,7 +161,7 @@ impl Version { for ver in vers { let version = Self::normalize(ver); if Some(&version) == cur.as_ref() { - log::warn!("{} is current active version, do not remove it", ver); + log::warn!("{} is current active version, ignore deletion!", ver); continue; } let version_dir = Dir::new(&home).version(&version); diff --git a/goup/src/command/mod.rs b/goup/src/command/mod.rs index dbc0b9e..b60d200 100644 --- a/goup/src/command/mod.rs +++ b/goup/src/command/mod.rs @@ -110,7 +110,7 @@ enum Command { #[cfg(unix)] /// write all necessary environment variables and values. Init(Init), - /// Show the specified goup environment and values. + /// Show the specified goup environment variables and values. Env(Env), }