Skip to content

Commit

Permalink
fix: trying to not clean download dir
Browse files Browse the repository at this point in the history
  • Loading branch information
juev committed Dec 11, 2023
1 parent 8d1c45f commit 23f722d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gobrew.go
Expand Up @@ -316,7 +316,7 @@ func (gb *GoBrew) Install(version string) string {

color.Infof("==> [Info] Downloading version: %s\n", version)
gb.downloadAndExtract(version)
gb.cleanDownloadsDir()
//gb.cleanDownloadsDir()
color.Successf("==> [Success] Downloaded version: %s\n", version)
return version
}
Expand Down
11 changes: 3 additions & 8 deletions helpers.go
Expand Up @@ -158,13 +158,8 @@ func (gb *GoBrew) print(message string, shouldPrint bool) {
func (gb *GoBrew) existsVersion(version string) bool {
path := filepath.Join(gb.versionsDir, version, "go")
_, err := os.Stat(path)
if err == nil {
return true
}
if os.IsNotExist(err) {
return false
}
return false

return err == nil
}

func (gb *GoBrew) cleanVersionDir(version string) {
Expand Down Expand Up @@ -350,7 +345,7 @@ func (gb *GoBrew) downloadAndExtract(version string) {
color.Infoln("==> [Info] Extract failed:", err)
os.Exit(1)
}
color.Infoln("[Success] Extract to", gb.getVersionDir(version))
color.Infoln("==> [Success] Extract to", gb.getVersionDir(version))
}

func (gb *GoBrew) changeSymblinkGoBin(version string) {
Expand Down

0 comments on commit 23f722d

Please sign in to comment.