pop-os / system76-driver

System76 Driver for Pop!_OS
Other
111 stars 28 forks source link

FileAction: Create parent directories if necessary #210

Closed jacobgkau closed 3 years ago

jacobgkau commented 3 years ago

Fixes #207.

Currently, the driver crashes if the parent directory of a config file being written with a FileAction doesn't exist. If this was intentional, then I could see the action just being skipped, but since it actually crashes, it doesn't seem intentional.

Thinking about whether an action should be skipped or performed anyway if the parent directory doesn't already exist, it seems like we'd want config files to be installed anyway, in case the user later installs the component we're trying to configure. In cases where the file is overwritten by the package being installed (such as with the pulseaudio file in #207), the driver will need to be reconfigured after the package is installed either way, so it doesn't really make a difference.

If this seems like a bad idea for any reason, we could instead just skip the action, which would still be better than crashing.