This project aims to provide a bash installer script to help in the installation of configuration files.
Copy/paste the ./install.sh
script into your project and starting from the directory level where you copied the script, use the whole or just a part of the following subtree:
So the
config
directory is at the same level as theinstall.sh
script.
Every files in:
config/copy/common/[TARGET_PATH]
: are copied to [TARGET_PATH]config/copy/[HOSTNAME]/[TARGET_PATH]
: are copied to [TARGET_PATH] only if [HOSTNAME] corresponds to the current${HOSTNAME}
config/link/common/[TARGET_PATH]
: are symlinked to [TARGET_PATH]config/link/[HOSTNAME]/[TARGET_PATH]
: are symlinked to [TARGET_PATH] only if [HOSTNAME] corresponds to the current${HOSTNAME}
config/run/common/after
: are executed after all other actions on all hostsconfig/run/[HOSTNAME]/after
: are executed after all other actions only if [HOSTNAME] corresponds to the current${HOSTNAME}
config/run/common/before
: are executed before all other actions on all hostsconfig/run/[HOSTNAME]/before
: are executed before all other actions only if [HOSTNAME] corresponds to the current${HOSTNAME}
Pkease note that the
common
namespace is used to share configurations across many hosts, while using aHOSTNAME
namespace permits to dedicate configurations to a specific host.
The common
namespace takes precedence over HOSTNAME
namespace, so every actions under the common
namespaces are executed first.
Actions are executed as follows:
config/run/common/before
config/run/[HOSTNAME]/before
config/copy/common/[TARGET_PATH]
config/copy/[HOSTNAME]/[TARGET_PATH]
config/link/common/[TARGET_PATH]
config/link/[HOSTNAME]/[TARGET_PATH]
config/run/common/after
config/run/[HOSTNAME]/after
Pkease note that inside a same namespace, actions are executed in alphabetical order based on their respective paths.
This project is licensed under the terms of the MIT License.