nea is boring

This commit is contained in:
echo 2022-12-15 02:31:45 +03:30
parent 55a5867e9b
commit c83c02f4f1

View file

@ -24,11 +24,11 @@ func getSubstring(s string, indices []int) string {
return string(s[indices[0]:indices[1]]) return string(s[indices[0]:indices[1]])
} }
func parseshell(bruh string) string { func getShellVersion(shellCommand string) string {
// https://www.youtube.com/watch?v=YPN0qhSyWy8 // https://www.youtube.com/watch?v=YPN0qhSyWy8
cmd := bruh + " --version | grep -o -E \"([0-9]\\.?)*\" | head -n1" cmd := shellCommand + " --version | grep -o -E \"([0-9]\\.?)*\" | head -n1"
out, _ := exec.Command("bash", "-c", cmd).Output() out, _ := exec.Command("bash", "-c", cmd).Output()
return bruh + " " + strings.ReplaceAll(string(out), "\n", "") return shellCommand + " " + strings.ReplaceAll(string(out), "\n", "")
} }
func handleConfig() { func handleConfig() {
@ -86,7 +86,7 @@ func handlePrint(action, format string, rest string) {
case "GPU": case "GPU":
utils.CutePrint(data.GetGPU(), format) utils.CutePrint(data.GetGPU(), format)
case "shell": case "shell":
utils.CutePrint(parseshell(data.GetShell()), format) utils.CutePrint(getShellVersion(data.GetShell()), format)
case "terminal": case "terminal":
utils.CutePrint(data.GetTerminal(), format) utils.CutePrint(data.GetTerminal(), format)
case "memoryAll": case "memoryAll":