Closed noraj closed 2 years ago
It's behavior for cook 1.6 (https://github.com/BlackArch/blackarch/issues/3278), I'm not sure if it really changed in 2.0
It should work in 2.0, But I will check it later.
Thanks @noraj for taking your time and suggesting these changes. I appreciate that.
Solved in #31
On BlackArch Linux we packaged cook this way: https://github.com/BlackArch/blackarch/blob/master/packages/cook/PKGBUILD
As for all ArchLinux packages, cook binary is deployed under
/usr/bin/cook
and config files under/urs/share/cook
(eg./usr/share/cook/cook.yaml
).Launching cook like that just fails because cook is not able to find it's configuration file
So as a workaround the user is forced to either define the conf file path with the environment variable or the parameter
It's happening because this was implemented rather than what I suggested.
I don't really know where cook is looking for it's config file because even if you copy
cook.yml
under/usr/bin
or in the working directory cook won't find it.There are 2 solutions to that:
Solution 1
Implementing a XDG compliant config deployment cf. https://github.com/giteshnxtlvl/cook/discussions/13#discussioncomment-684604
Solution 2
define a go BUILD variable to defined the install path, so when the binary is build any linux distro maintainer would be able to define
INSTALLDIR=/usr/bin/cook
and cook would look here for it's config file.Idea
I think any tool creator should think about "how OS maintainers/packagers will deploy my tool on their OS" rather than assume that people will just git clone the tool cd in the repo and do
./tool
. Else it prevent for mass deployment on OSes or complexify the work of OS packagers.