polybar-dwm/include/utils
TheDoctor314 6d1ff41d37
Handle relative includes (#2535)
* Handle relative includes

We change to the directory of the given config file before parsing.
This allows us to handle relative includes.
TODO: Maybe improve the name of the change_dir() function.

* Fix unused result warning

* Add `relative_to` parameter to expand()

If the path is relative, we resolve it by prepending
dirname(config) to the path.

Add dirname() - Returns the parent directory of the file or an empty
string.

* Resolve relative paths

Handle paths relative to the current file being parsed.

* Remove unneeded change_dir()

* Fix expand()

`is_absolute` is calculated after we expand the path.
`relative_to` must be a directory.

Add test for expand() with relative paths

* Recalculate `is_absolute` after expanding `path`

* Add more file_util::expand tests

* Add changelog

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2021-10-20 12:31:15 +02:00
..
action_router.hpp fix(modules): Avoid downcast in module constructor 2021-10-03 03:18:39 +02:00
actions.hpp
bspwm.hpp
color.hpp
command.hpp Include fd_stream in command.hpp (#2533) 2021-10-12 19:33:15 +02:00
concurrency.hpp Remove unused spin_lock 2021-09-21 21:43:27 +02:00
env.hpp
factory.hpp Remove factory_util unique and shared 2021-09-21 21:43:27 +02:00
file.hpp Handle relative includes (#2535) 2021-10-20 12:31:15 +02:00
functional.hpp
http.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
i3.hpp
inotify.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
io.hpp script: Fix concurrency issues (#2518) 2021-10-03 01:27:11 +02:00
math.hpp fix: unbounded_percentage always rounded down 2021-03-03 22:48:17 +01:00
memory.hpp
mixins.hpp
process.hpp Add env parameter to exec_sh() 2021-09-28 22:16:07 +02:00
scope.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
socket.hpp Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
string.hpp Create default config (#2511) 2021-10-05 13:07:19 +02:00
time.hpp