From c83c02f4f1126afe6e4f2d7da00a20450fbc0da8 Mon Sep 17 00:00:00 2001 From: echo <91651232+exhq@users.noreply.github.com> Date: Thu, 15 Dec 2022 02:31:45 +0330 Subject: [PATCH] nea is boring --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index dd46626..69fd71a 100644 --- a/main.go +++ b/main.go @@ -24,11 +24,11 @@ func getSubstring(s string, indices []int) string { return string(s[indices[0]:indices[1]]) } -func parseshell(bruh string) string { +func getShellVersion(shellCommand string) string { // 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() - return bruh + " " + strings.ReplaceAll(string(out), "\n", "") + return shellCommand + " " + strings.ReplaceAll(string(out), "\n", "") } func handleConfig() { @@ -86,7 +86,7 @@ func handlePrint(action, format string, rest string) { case "GPU": utils.CutePrint(data.GetGPU(), format) case "shell": - utils.CutePrint(parseshell(data.GetShell()), format) + utils.CutePrint(getShellVersion(data.GetShell()), format) case "terminal": utils.CutePrint(data.GetTerminal(), format) case "memoryAll":