You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that it would be really nice to have a way to pass options to dotbot via. the install script. For example, most of the time I don't want the chatty version of dotbot, I just want to know if things failed. I'm torn over whether or not being able to override the config suffix and basedir makes any sense, but it was easy enough to add so I left it in the code for now.
Here is the version of the script I am using (along with the change elsewhere in your Issues to allow for multiple config files).
#!/usr/bin/env bash
set -e
DEFAULT_CONFIG_PREFIX="default"
CONFIG_SUFFIX=".conf.yaml"
DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Parse command line options
DOTBOTOPTS=""
VERBOSE=""
while getopts "Qqvd:c:" opt; do
case $opt in
v|Q|q)
VERBOSE=$opt
DOTBOTOPTS="$DOTBOTOPTS -$opt"
;;
d)
BASEDIR=$opt
;;
c)
CONFIG_SUFFIX=$opt
;;
?)
exit 1
;;
esac
done
# Clean up parsed options
while (( $((OPTIND--)) > 1 )); do
shift
done
cd "${BASEDIR}"
git submodule update --init --recursive "${DOTBOT_DIR}"
for conf in ${DEFAULT_CONFIG_PREFIX} ${@}; do
if [ $VERBOSE != "Q" ]; then
echo -e "\nInstalling $conf..."
fi
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" ${DOTBOTOPTS} -d "${BASEDIR}" -c "${conf}${CONFIG_SUFFIX}"
done
The text was updated successfully, but these errors were encountered:
Unless you use the multi-config version of the script, then that gets parsed in the 'for conf' loop. My change above adds parsing of the non-config file options.
I found that it would be really nice to have a way to pass options to dotbot via. the install script. For example, most of the time I don't want the chatty version of dotbot, I just want to know if things failed. I'm torn over whether or not being able to override the config suffix and basedir makes any sense, but it was easy enough to add so I left it in the code for now.
Here is the version of the script I am using (along with the change elsewhere in your Issues to allow for multiple config files).
The text was updated successfully, but these errors were encountered: