Skip to content

Commit

Permalink
fix: fix doc and log
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkgos committed Jan 30, 2024
1 parent 663db2a commit d74d126
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|---------|--------|
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions goup-downloader/src/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down
4 changes: 2 additions & 2 deletions goup-version/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion goup/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

Expand Down

0 comments on commit d74d126

Please sign in to comment.