Skip to content

Commit

Permalink
make more efficent
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hellum committed May 4, 2021
1 parent cb5019a commit 38cde0d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions internal/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ func Ls(path string) {
fmt.Println(" │ \033[0;32m" + strconv.Itoa(i) + spaces2 + "\033[0m │ \033[0;36m" +
file.Name() + spaces + "\033[0m│ Directory \033[0m│")
}
} else if file.Mode().String() == "-rwxr-xr-x" {
if i >= 10 {
fmt.Println(" │ \033[0;32m" + strconv.Itoa(i) + spaces2 + "\033[0m│ \033[0;33m" +
file.Name() + spaces + "\033[0m│ File \033[0m│")
} else {
fmt.Println(" │ \033[0;32m" + strconv.Itoa(i) + spaces2 + "\033[0m │ \033[0;33m" +
file.Name() + spaces + "\033[0m│ File \033[0m│")
}
} else {
if i >= 10 {
fmt.Println(" │ \033[0;32m" + strconv.Itoa(i) + spaces2 + "\033[0m│ " + file.Name() + spaces +
Expand All @@ -49,9 +41,17 @@ func Ls(path string) {
fmt.Println(" │ \033[0;32m" + strconv.Itoa(i) + spaces2 + "\033[0m │ " + file.Name() + spaces +
"\033[0m│ File \033[0m│")
}








}
}
fmt.Println(" ╰━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━╯")
fmt.Println(" ╰━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━╯")
}

type nodeValue string
Expand Down

0 comments on commit 38cde0d

Please sign in to comment.