install.fairie/docs/scripts/overview/before.md
2023-08-08 03:06:49 -04:00

1.7 KiB

title description sidebar_label slug
Before Scripts Overview Read about how Install Doctor incorporates shell scripting languages into the provisioning process by running scripts before the Chezmoi file provisioning process. Before Scripts /scripts/before

Certain scripts included in the Install Doctor project have to run before the configuration files have been generated and applied to the system. These scripts prepare the system by ensuring private keys used for encryption are available and that the required provisioning programs are available on the system. All of these files include before_ in their filename and are located in the home/.chezmoiscripts/universal/ folder. The majority of the scripts leveraged by Install Doctor are kept in the universal/ folder so that the script execution order can be controlled.

Script Execution Order

Just like the After Scripts, the Before Scripts run synchronously in order of file name. This is why all of the files include a two-digit numerical identifier after their file name directives. This two-digit numerical identifier provides a way of controlling the order that the scripts execute.

For example, the file home/.chezmoiscripts/universal/run_before_01-decrypt-age-key.sh.tmpl has a numerical identifier of 01. This identifier causes the script to be listed alphabetically before other scripts with higher numerical identifiers.