PuellaeMagicae / unix-in-lisp

Mount Unix system into Common Lisp image
141 stars 7 forks source link

add option `*path-warning*` to missing dir in $PATH mount warnings #16

Closed WillForan closed 1 week ago

WillForan commented 1 week ago

I'm sending this along in case it's useful, but please reject if not -- I'm still working on getting a grasp of what lisp code should look like.

My $PATH has accumulated a lot of detritus -- folders that were removed, never exist on this hosts, and folders that are now symlinks to a file. So the post-command-hook mount was spitting out a lot of warnings every prompt. This is my lazy solution.

*path-warning* is a knob to toggle warnings that otherwise are seen before every prompt.

E.g.

Failed to mount ... in $PATH: ... is a regular-file, wanted (directory). warning: Failed to mount /opt/afni/ in $PATH: /opt/afni/ does not exist.

A better fix is to maintain a hygienic $PATH. But after launching unix-in-lisp, it's maybe too late?

(setf (uiop:getenv "PATH") "/usr/bin") ; PATH remains unchanged?
kchanqvq commented 1 week ago

Thank you for the PRs! I appreciate the contributions! Can you update according to my comment?