Skip to content

Commit

Permalink
fix(app): deleting temporary files before updating
Browse files Browse the repository at this point in the history
  • Loading branch information
varrcan committed Dec 12, 2021
1 parent df135a7 commit 8ebf955
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions command/self_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ func extractArchive(archivePath string) error {
tarReader := tar.NewReader(uncompressedStream)

tmpPath := filepath.Join(os.TempDir(), "dl")

_, err = os.Stat(tmpPath)
if err == nil {
err = os.RemoveAll(tmpPath)
if err != nil {
return err
}
}

if err := os.Mkdir(tmpPath, 0755); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/varrcan/dl/helper"
)

var version = "0.2.1"
var version = "0.2.2"

func main() {
if !helper.IsConfigDirExists() {
Expand Down

0 comments on commit 8ebf955

Please sign in to comment.