Skip to content

Commit

Permalink
Removes debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
leucos committed Aug 18, 2020
1 parent 9000748 commit 7043d81
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
2 changes: 0 additions & 2 deletions internal/fetch/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ func (d Download) Fetch(ctx context.Context, v string) (string, error) {
// Write the body to file
_, err = io.Copy(tmpfile, resp.Body)

log.Debugf("file saved at %q\n", tmpfile.Name())

return tmpfile.Name(), err
}
6 changes: 0 additions & 6 deletions internal/install/tgz.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package install
import (
"archive/tar"
"compress/gzip"
"fmt"
"io"
"log"
"os"
Expand Down Expand Up @@ -44,8 +43,6 @@ func (t Tgz) Install(src, dst, version string) error {
return err
}

fmt.Printf("found file %s in tar\n", header.Name)

switch header.Typeflag {
case tar.TypeReg: // regular file
ok, err := args.MatchFilters(header.Name, t.filters)
Expand All @@ -55,20 +52,17 @@ func (t Tgz) Install(src, dst, version string) error {
if !ok {
continue
}
fmt.Printf("found matching file %s size %d\n", header.Name, header.Size)

out, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0750)
if err != nil {
return err
}
defer out.Close()
fmt.Printf("writing file to %s\n", dst)
if _, err := io.Copy(out, tarReader); err != nil {
log.Fatal(err)
}
}
}
fmt.Printf("finished parsing tar")

return nil
}
12 changes: 0 additions & 12 deletions internal/install/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package install

import (
"archive/zip"
"fmt"
"io"
"os"

Expand All @@ -26,15 +25,6 @@ func (z Zip) Install(src, dst, version string) error {

args := tpl.New(version)
for _, f := range r.File {
fmt.Printf("found file %s in zip\n", f.Name)

// fpath := filepath.Join(dst, f.Name)

// Check for ZipSlip. More Info: http://bit.ly/2MsjAWE
// if !strings.HasPrefix(dst, filepath.Clean(dst)+string(os.PathSeparator)) {
// return fmt.Errorf("%s: illegal file path", dst)
// }

ok, err := args.MatchFilters(f.Name, z.filters)
if err != nil {
return err
Expand All @@ -43,8 +33,6 @@ func (z Zip) Install(src, dst, version string) error {
continue
}

fmt.Printf("installing in %s\n", dst)

out, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0750)
if err != nil {
return err
Expand Down

0 comments on commit 7043d81

Please sign in to comment.