Closed the-fuckin-nobody closed 4 months ago
thank you for pointing that, out i fixed the mistake in the last commit.
Yeah this seems good and fixes issues with sudo make install
, but what if someone runs sudo make
instead of just make
it would still result in copying to the wrong path. Maybe add a note in the README.md , to not run sudo make
or maybe just change the whole idea of using the ~/.leif
directory and instead use some dir in /usr/local/...
dir so, an absolute path is used instead. I'm happy to help with a PR for that if you're busy or smth. It just requires changing some strings in leif.c
lol .
LfFont lf_load_font_asset(const char* asset_name, const char* file_extension, uint32_t font_size) {
char leif_dir[strlen(getenv(HOMEDIR)) + strlen("/.leif")]; // <--- here
memset(leif_dir, 0, sizeof(leif_dir)); //<---maybe here
strcat(leif_dir, getenv(HOMEDIR)); //<---- here
strcat(leif_dir, "/.leif");// <---- and here too
I do not want to sound too much complaining , but its good to avoid tilde expansion paths in the Makefile. Great work on this project.
If you could open a PR i would greatly appreciate that. New contributors are always welcome :)
Sorry couldn't add a PR due to some issues IRL. As the install.sh script provided fixes this issue, I'm closing this one :-)
Found out this while trying to run your music player lyssa, the error is :
Then I looked at the
Makefile
forleif
. The install section of theMakefile
tries to copy the.leif
directory to~/
, See here:The intended behavior is that to copy the
.leif
directory touser's home
dir, but when used with sudo command, due to privilege escalation, the.leif
directory gets copied toroot's home
, .i.e/root/
, So when I try to runlyssa
, it gives the aforementioned error, since there is no.leif
directory in theuser's home
, it is inroot's home
instead. Same error is withlyssa's Makefile
too , the.lyssa
directory get's copied toroot's home
, rather thanuser's home
. Don't know if this is intentional but since the binary is looking for the dotfile in theuser's home
instead ofroot's home
, I raised this issue.Steps to reproduce: