From 01d937afd89c884d6fe4b03a0a4d96a680eaa5cf Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Wed, 16 Mar 2022 18:42:38 -0400 Subject: [PATCH] fix: correct username in greeting on windows --- api.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api.go b/api.go index 417104c..ffa68e1 100644 --- a/api.go +++ b/api.go @@ -48,15 +48,15 @@ func hilbishLoader(L *lua.LState) int { host, _ := os.Hostname() username := curuser.Username - greeting = `Welcome to {magenta}Hilbish{reset}, {cyan}` + curuser.Username + `{reset}. -The nice lil shell for {blue}Lua{reset} fanatics! -Check out the {blue}{bold}guide{reset} command to get started. -` - if runtime.GOOS == "windows" { username = strings.Split(username, "\\")[1] // for some reason Username includes the hostname on windows } + greeting = `Welcome to {magenta}Hilbish{reset}, {cyan}` + username + `{reset}. +The nice lil shell for {blue}Lua{reset} fanatics! +Check out the {blue}{bold}guide{reset} command to get started. +` + util.SetField(L, mod, "ver", lua.LString(version), "Hilbish version") util.SetField(L, mod, "user", lua.LString(username), "Username of user") util.SetField(L, mod, "host", lua.LString(host), "Host name of the machine")