Skip to content

Commit

Permalink
mod: clear env
Browse files Browse the repository at this point in the history
  • Loading branch information
aooohan committed May 18, 2024
1 parent dedfdc5 commit e79bff7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,6 @@ func (b *Sdk) label(version Version) string {
func (b *Sdk) ClearCurrentEnv() error {
current := b.Current()

fmt.Println("Cleaning up current link...")
curPath := filepath.Join(b.InstallPath, "current")
if err := os.RemoveAll(curPath); err != nil {
return fmt.Errorf("failed to remove current link, err:%w", err)
}

if current != "" {
envKeys, err := b.MockEnvKeys(current, GlobalLocation)
if err != nil {
Expand Down Expand Up @@ -739,6 +733,12 @@ func (b *Sdk) ClearCurrentEnv() error {
_ = envManager.Flush()
}

fmt.Println("Cleaning up current link...")
curPath := filepath.Join(b.InstallPath, "current")
if err := os.RemoveAll(curPath); err != nil {
return fmt.Errorf("failed to remove current link, err:%w", err)
}

// clear tool versions
toolVersion, err := toolset.NewMultiToolVersions([]string{
b.sdkManager.PathMeta.CurTmpPath,
Expand Down

0 comments on commit e79bff7

Please sign in to comment.