ensure that the .config path exists before writing

mkdir -p is safe in that it creates all intervening directories and does
not complain if they already exist.

Currently the write to ~/.config/systemd/user/tmux.service fails if the
~/.config/systemd/user directory isn't already existing.
pull/102/head
mattkatz 2022-01-20 17:43:22 -05:00
parent c7bd206516
commit 06ba783fc4
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ systemd_unit_file() {
}
write_unit_file() {
# it never hurts to make sure the directory we are writing into exists
mkdir -p "${systemd_config_path}"
systemd_unit_file > "${systemd_unit_file_path}"
}