From 667b411b9f40c074a9046a73528033b494323eb6 Mon Sep 17 00:00:00 2001 From: leath-dub Date: Sun, 9 Jun 2024 10:35:16 +0100 Subject: [PATCH 1/2] feat: preliminary freebsd support --- CHANGELOG.md | 1 + execfile_unix.go | 2 +- job_unix.go | 2 +- signal_unix.go | 2 +- vars_freebsd.go | 21 +++++++++++++++++++++ 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 vars_freebsd.go diff --git a/CHANGELOG.md b/CHANGELOG.md index e6eeed8..c53ff4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ hilbish.run('wc -l', { ### Fixed - Fix ansi attributes causing issues with text when cut off in greenhouse +- Fix not compiling on freebsd ## [2.2.3] - 2024-04-27 ### Fixed diff --git a/execfile_unix.go b/execfile_unix.go index 44f924a..fd83f56 100644 --- a/execfile_unix.go +++ b/execfile_unix.go @@ -1,4 +1,4 @@ -// +build linux darwin +// +build unix package main diff --git a/job_unix.go b/job_unix.go index 5029012..8482294 100644 --- a/job_unix.go +++ b/job_unix.go @@ -1,4 +1,4 @@ -// +build darwin linux +// +build unix package main diff --git a/signal_unix.go b/signal_unix.go index 2e6c885..921c4b8 100644 --- a/signal_unix.go +++ b/signal_unix.go @@ -1,4 +1,4 @@ -// +build darwin linux +// +build unix package main diff --git a/vars_freebsd.go b/vars_freebsd.go new file mode 100644 index 0000000..cc1cb93 --- /dev/null +++ b/vars_freebsd.go @@ -0,0 +1,21 @@ +// +build freebsd + +package main + +// String vars that are free to be changed at compile time +var ( + requirePaths = commonRequirePaths + `.. ';' + .. hilbish.dataDir .. '/libs/?/init.lua;' + .. hilbish.dataDir .. '/libs/?/?.lua;'` + freebsdUserPaths + freebsdUserPaths = ` + .. hilbish.userDir.data .. '/hilbish/libs/?/init.lua;' + .. hilbish.userDir.data .. '/hilbish/libs/?/?.lua;' + .. hilbish.userDir.data .. '/hilbish/libs/?.lua;' + .. hilbish.userDir.config .. '/hilbish/?/init.lua;' + .. hilbish.userDir.config .. '/hilbish/?/?.lua;' + .. hilbish.userDir.config .. '/hilbish/?.lua'` + dataDir = "/usr/local/share/hilbish" + preloadPath = dataDir + "/nature/init.lua" + sampleConfPath = dataDir + "/.hilbishrc.lua" // Path to default/sample config + defaultConfDir = "" +) From d47d23ea3e4317734a911441d77c7799be08e10b Mon Sep 17 00:00:00 2001 From: leath-dub Date: Fri, 14 Jun 2024 19:34:42 +0100 Subject: [PATCH 2/2] moved linux and freebsd file to a single unix file --- vars_linux.go | 21 --------------------- vars_freebsd.go => vars_unix.go | 6 +++--- 2 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 vars_linux.go rename vars_freebsd.go => vars_unix.go (87%) diff --git a/vars_linux.go b/vars_linux.go deleted file mode 100644 index e1160ba..0000000 --- a/vars_linux.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build linux - -package main - -// String vars that are free to be changed at compile time -var ( - requirePaths = commonRequirePaths + `.. ';' - .. hilbish.dataDir .. '/libs/?/init.lua;' - .. hilbish.dataDir .. '/libs/?/?.lua;'` + linuxUserPaths - linuxUserPaths = ` - .. hilbish.userDir.data .. '/hilbish/libs/?/init.lua;' - .. hilbish.userDir.data .. '/hilbish/libs/?/?.lua;' - .. hilbish.userDir.data .. '/hilbish/libs/?.lua;' - .. hilbish.userDir.config .. '/hilbish/?/init.lua;' - .. hilbish.userDir.config .. '/hilbish/?/?.lua;' - .. hilbish.userDir.config .. '/hilbish/?.lua'` - dataDir = "/usr/local/share/hilbish" - preloadPath = dataDir + "/nature/init.lua" - sampleConfPath = dataDir + "/.hilbishrc.lua" // Path to default/sample config - defaultConfDir = "" -) diff --git a/vars_freebsd.go b/vars_unix.go similarity index 87% rename from vars_freebsd.go rename to vars_unix.go index cc1cb93..224a295 100644 --- a/vars_freebsd.go +++ b/vars_unix.go @@ -1,4 +1,4 @@ -// +build freebsd +// +build linux freebsd package main @@ -6,8 +6,8 @@ package main var ( requirePaths = commonRequirePaths + `.. ';' .. hilbish.dataDir .. '/libs/?/init.lua;' - .. hilbish.dataDir .. '/libs/?/?.lua;'` + freebsdUserPaths - freebsdUserPaths = ` + .. hilbish.dataDir .. '/libs/?/?.lua;'` + unixUserPaths + unixUserPaths = ` .. hilbish.userDir.data .. '/hilbish/libs/?/init.lua;' .. hilbish.userDir.data .. '/hilbish/libs/?/?.lua;' .. hilbish.userDir.data .. '/hilbish/libs/?.lua;'