feat: support comptime sample conf declaration

pull/61/head
sammyette 2021-06-09 20:33:30 -04:00
parent 13dc0cd857
commit 646cb93dec
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
2 changed files with 4 additions and 3 deletions

View File

@ -95,9 +95,9 @@ func main() {
input, err := os.ReadFile(".hilbishrc.lua")
if err != nil {
// If it wasnt found, go to the real sample conf
input, err = os.ReadFile("/usr/share/hilbish/.hilbishrc.lua")
input, err = os.ReadFile(sampleConfPath)
if err != nil {
fmt.Println("could not find .hilbishrc.lua or /usr/share/hilbish/.hilbishrc.lua")
fmt.Println("could not find .hilbishrc.lua or", sampleConfPath)
return
}
}

View File

@ -10,7 +10,8 @@ var (
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?/?.lua;'
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?.lua'`
preloadPath = "/usr/share/hilbish/preload.lua"
defaultConfDir = "" // ~ will be substituted for home
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config
prompt string // Prompt will always get changed anyway
multilinePrompt = "> "