mirror of https://github.com/Hilbis/Hilbish
fix: correct username in greeting on windows
parent
32b421d402
commit
01d937afd8
10
api.go
10
api.go
|
@ -48,15 +48,15 @@ func hilbishLoader(L *lua.LState) int {
|
||||||
host, _ := os.Hostname()
|
host, _ := os.Hostname()
|
||||||
username := curuser.Username
|
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" {
|
if runtime.GOOS == "windows" {
|
||||||
username = strings.Split(username, "\\")[1] // for some reason Username includes the hostname on 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, "ver", lua.LString(version), "Hilbish version")
|
||||||
util.SetField(L, mod, "user", lua.LString(username), "Username of user")
|
util.SetField(L, mod, "user", lua.LString(username), "Username of user")
|
||||||
util.SetField(L, mod, "host", lua.LString(host), "Host name of the machine")
|
util.SetField(L, mod, "host", lua.LString(host), "Host name of the machine")
|
||||||
|
|
Loading…
Reference in New Issue