Skip to content

Commit

Permalink
chore: general cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
M0Rf30 committed Aug 7, 2023
1 parent 865db1c commit 74af4d3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion debian/debian.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
type Debian struct {
debDir string
PKGBUILD *pkgbuild.PKGBUILD
// sums string
}

func (d *Debian) getArch() {
Expand Down
2 changes: 0 additions & 2 deletions pkgbuild/pkgbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ func (p *PKGBUILD) CreateSpec(filePath string, script string) error {
log.Panic(err)
}

// remember to close the file
defer file.Close()
// create new buffer
writer := io.Writer(file)

tmpl := template.New("template")
Expand Down
9 changes: 1 addition & 8 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,12 @@ func Unarchive(archiveReader io.Reader, destination string) error {
return os.MkdirAll(newPath, archiveFile.Mode())
}

// check if we've seen the dir before, if not, we'll attempt to create
// it in case its not there. This needs to be done as archive formats
// do not necessarily always have the directory in order/present
// eg zip dirs for quarto definitely are missing seemingly random dirs
// when talking with charles about it, we were both unsure what might
// be the reason, and assume its probably the powershell compress-archive
// encantation, so rather than trying to go down that rabbit hole too far,
// some additional checking here
fileDir := filepath.Dir(newPath)
_, seenDir := dirMap[fileDir]

if !seenDir {
dirMap[fileDir] = true

Check failure on line 188 in utils/utils.go

View workflow job for this annotation

GitHub Actions / golangci-lint-github-check

[golangci-lint-github-check] utils/utils.go#L188

File is not `gci`-ed with --skip-generated -s standard -s default (gci)
Raw output
utils/utils.go:188: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
			
// linux default for new directories is 777 and let the umask handle
// if should have other controls
err = os.MkdirAll(fileDir, 0777)
Expand Down

0 comments on commit 74af4d3

Please sign in to comment.