disable hidden on windows

This commit is contained in:
Gokcehan committed 2019-03-31 23:39:41 +03:00
1 parent 45270e389e
commit b2b22fb674
3 files changed
+12 -3

No files matched your search

+3 -3
View File
@@ -144,13 +144,13 @@ func (dir *dir) sort() {
// files to the first non-hidden file in the list
if gOpts.sortType.option&hiddenSort == 0 {
sort.SliceStable(dir.files, func(i, j int) bool {
if dir.files[i].Name()[0] == '.' && dir.files[j].Name()[0] == '.' {
if isHidden(dir.files[i]) && isHidden(dir.files[j]) {
return i < j
}
return dir.files[i].Name()[0] == '.'
return isHidden(dir.files[i])
})
for i, f := range dir.files {
if f.Name()[0] != '.' {
if isHidden(f) {
dir.files = dir.files[i:]
return
}
+4
View File
@@ -133,6 +133,10 @@ func isExecutable(f os.FileInfo) bool {
return f.Mode()&0111 != 0
}
func isHidden(f os.FileInfo) bool {
return f.Name()[0] == '.'
}
func exportFiles(f string, fs []string) {
envFile := f
envFiles := strings.Join(fs, gOpts.filesep)
+5
View File
@@ -116,6 +116,11 @@ func isExecutable(f os.FileInfo) bool {
return false
}
func isHidden(f os.FileInfo) bool {
// TODO: implement
return false
}
func exportFiles(f string, fs []string) {
envFile := fmt.Sprintf(`"%s"`, f)