Closed Holt59 closed 4 years ago
I'm not sure I like blindly going up directories until an ini is found. I was doing something similar before to allow running from build/Debug/x64
and still find mob.ini
in the project root, but I've changed it to really make sure it's the build directory by checking for Debug
and Release
.
On the other hand, I could consider that any mob.ini
I find in a parent directory is the root of a mob project. In fact, after a mob -d prefix build
, I could drop an empty mob.ini
in prefix
as an anchor. Thinking out loud while having coffee.
I thought about checking for more stuffs, e.g., build
, downloads
, etc., but creating a mob.ini
with a paths/prefix=.
after (or before) a mob build
might be a good idea.
Updated to drop a mob.ini
with only
[paths]
prefix = .
in the build directory if not present. I had to create the build directory there as it does not seem to be created yet.
Holt, this has been sitting in my inbox for months, how useful is it?
For me it's pretty useful, which is why I rebase
it to follow master every time. I run mob
from anywhere under the build tree without thinking where I am.
One minor issue with the current version is that it creates mob.log
in the current directory, hence I have mob.log
about everywhere...
What if I change the generated ini to use an absolute path for log_file
set to prefix()/mob.log
?
Yes, would be nice.
Or maybe make log_file
be relative to the prefix instead of the current folder?
Will do.
Since there is no easy way of checking if a
.ini
contains apaths/prefix
entry infind_inis
, I simply stop at the first.ini
found, which should be enough.The
init_options
is a bit more messy since I need to remember which.ini
contained thepaths/prefix
. Maybe I could assume the last one in the list? But I still would have to check if the prefix is given in the command line.