fix: add commonRequirePaths and linuxUserPaths to avoid repetition with custom require paths

pull/78/head
sammyette 2021-10-17 16:27:14 -04:00
parent 3d53e85fc9
commit 7a3d9022e9
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
3 changed files with 5 additions and 3 deletions

View File

@ -5,6 +5,7 @@ var (
version = "v0.5.1" version = "v0.5.1"
defaultConfDir = "" // ~ will be substituted for home, path for user's default config defaultConfDir = "" // ~ will be substituted for home, path for user's default config
defaultHistDir = "" defaultHistDir = ""
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"
prompt string // Prompt will always get changed anyway prompt string // Prompt will always get changed anyway
multilinePrompt = "> " multilinePrompt = "> "

View File

@ -4,9 +4,10 @@ package main
// String vars that are free to be changed at compile time // String vars that are free to be changed at compile time
var ( var (
requirePaths = `';./libs/?/?.lua;./libs/?/init.lua;./?/init.lua;./?/?.lua' requirePaths = commonRequirePaths + `
.. ';/usr/share/hilbish/libs/?/init.lua;' .. ';/usr/share/hilbish/libs/?/init.lua;'
.. ';/usr/share/hilbish/libs/?/?.lua;' .. ';/usr/share/hilbish/libs/?/?.lua;'` + linuxUserPaths
linuxUserPaths = `
.. hilbish.xdg.data .. '/hilbish/libs/?/init.lua;' .. hilbish.xdg.data .. '/hilbish/libs/?/init.lua;'
.. hilbish.xdg.data .. '/hilbish/libs/?/?.lua;' .. hilbish.xdg.data .. '/hilbish/libs/?/?.lua;'
.. hilbish.xdg.data .. '/hilbish/libs/?.lua' .. hilbish.xdg.data .. '/hilbish/libs/?.lua'

View File

@ -4,7 +4,7 @@ package main
// String vars that are free to be changed at compile time // String vars that are free to be changed at compile time
var ( var (
requirePaths = `';./libs/?/init.lua;./?/init.lua;./?/?.lua' requirePaths = commonRequirePaths + `
.. hilbish.home .. '\\Appdata\\Roaming\\Hilbish\\libs\\?\\init.lua;' .. hilbish.home .. '\\Appdata\\Roaming\\Hilbish\\libs\\?\\init.lua;'
.. hilbish.home .. '\\Appdata\\Roaming\\Hilbish\\libs\\?\\?.lua;'` .. hilbish.home .. '\\Appdata\\Roaming\\Hilbish\\libs\\?\\?.lua;'`
dataDir = "~\\Appdata\\Roaming\\Hilbish" // ~ and \ gonna cry? dataDir = "~\\Appdata\\Roaming\\Hilbish" // ~ and \ gonna cry?