MCPcopy Index your code
hub / github.com/devspace-sh/devspace / chmodTarEntry

Function chmodTarEntry

pkg/devspace/sync/tar.go:355–368  ·  view source on GitHub ↗

chmodTarEntry is used to adjust the file permissions used in tar header based on the platform the archival is done.

(perm os.FileMode)

Source from the content-addressed store, hash-verified

353// chmodTarEntry is used to adjust the file permissions used in tar header based
354// on the platform the archival is done.
355func chmodTarEntry(perm os.FileMode) os.FileMode {
356 if runtime.GOOS != "windows" {
357 return perm
358 }
359
360 // perm &= 0755 // this 0-ed out tar flags (like link, regular file, directory marker etc.)
361 permPart := perm & os.ModePerm
362 noPermPart := perm &^ os.ModePerm
363 // Add the x bit: make everything +x from windows
364 permPart |= 0111
365 permPart &= 0755
366
367 return noPermPart | permPart
368}
369
370// fillGo18FileTypeBits fills type bits which have been removed on Go 1.9 archive/tar
371// https://github.com/golang/go/commit/66b5a2f

Callers 2

tarFolderMethod · 0.85
tarFileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected