Compare commits

..

No commits in common. "b221921ab7e2214e4107a89d7e8b00fe3f31424b" and "21b093559a6c911733b26b7e5cb81830475542d3" have entirely different histories.

4 changed files with 17 additions and 2 deletions

View File

@ -38,8 +38,6 @@ the config path.
- `hilbish.xdg` no longer exists, use `hilbish.userDir` instead,
as it functions the same and is OS agnostic
- `hilbish.flag` has been removed
- `~/.hprofile.lua` has been removed, instead check in your config if `hilbish.login`
is true
## [0.7.1] - 2021-11-22
### Fixed

View File

@ -19,6 +19,7 @@ func runInput(input string) {
running = true
cmdString := aliases.Resolve(input)
// If alias was found, use command alias
hooks.Em.Emit("command.preexec", input, cmdString)
// First try to load input, essentially compiling to bytecode

15
lua.go
View File

@ -72,3 +72,18 @@ func runConfig(confpath string) {
l.DoString(minimalconf)
}
}
func runLogin() {
if _, err := os.Stat(curuser.HomeDir + "/.hprofile.lua"); os.IsNotExist(err) {
return
}
if !login {
return
}
err := l.DoFile(curuser.HomeDir + "/.hprofile.lua")
if err != nil {
fmt.Fprintln(os.Stderr, err,
"\nAn error has occured while loading your login config!n")
}
}

View File

@ -115,6 +115,7 @@ func main() {
go handleSignals()
luaInit()
runLogin()
// If user's config doesn't exixt,
if _, err := os.Stat(defaultConfPath); os.IsNotExist(err) && *configflag == defaultConfPath {
// Read default from current directory