Update build.sh to error-out on bad $BUILD or $BIN#1882
Update build.sh to error-out on bad $BUILD or $BIN#1882wilsonjholmes wants to merge 3 commits intoKLayout:masterfrom
build.sh to error-out on bad $BUILD or $BIN#1882Conversation
|
Thanks for the patch. Regarding "readlink" vs. "realpath", the situation is confusing. I found this post: https://unix.stackexchange.com/questions/136494/whats-the-difference-between-realpath-and-readlink-f - my takeaway is that "readlink" is the older, yet more portable solution. But I do not fully understand the original problem: you can run "build.sh" with non-existing bin and build folders, using This works as the build script does a "mkdir" on the build folder and the creation of the bin folder is manages my the install step. Problems may arise if mkdir is not able to create the folder. I like the "-e" option in bash, but my experience is that sometimes it errors out unintentionally - for example on "grep". I think is somewhat safer to specifically test the exit code of "mkdir", like Matthias |
Ahh, I believe this may have been my actual problem. If I recall correctly, I passed in some paths that my user did not have write permissions for, which resulted in some initially confusing breakage. |
I tried to install to a directory that did not exist, and I got some unexpected behavior...
build.shdid not fail, it just continued to run and spew-out errors.I added a
-eafter the bash sh-bang to help with catching issues sooner (portion of man page pasted below), and I changedreadlink -ftorealpath --canonicalize-existing(man page pasted also):Honestly, not sure if this would work on all POSIX-like systems that the project is targeting, but it built for me on Pop!_OS 22.04 LTS and
klayoutlaunches.I am open to suggestions or learnings if
realpathor-eis not suitable for some reason.