1234567891011121314151617181920212223242526272829303132333435 |
- #!/bin/bash
- set -e
- source ./conf.sh
- declare -a INSTALLED=("lib" "${INSTALLED_CONFIGS[@]}")
- # Remove old outputed file
- if [ -f $CONFIG_OUTPUT_FILE ]
- then
- rm $CONFIG_OUTPUT_FILE
- fi
- echo ""
- # Shortcuts to edit configs
- echo "alias ec='vi ${CONFIG_INSTALL_DIR}'" >> $CONFIG_OUTPUT_FILE
- echo "alias uc='(cd ${CONFIG_INSTALL_DIR} && ./install.sh) && echo \"Loading ${CONFIG_INSTALL_DIR}/${CONFIG_OUTPUT_FILE}\" && source ${CONFIG_INSTALL_DIR}/${CONFIG_OUTPUT_FILE}'" >> $CONFIG_OUTPUT_FILE
- echo "alias cd_configs='cd ${CONFIG_INSTALL_DIR}'" >> $CONFIG_OUTPUT_FILE
- # Check all scripts have valid syntax before wiping out the old script
- for f in "${INSTALLED[@]}"
- do
- echo "Checking $f.sh"
- bash -n "$f.sh"
- done
- # Cat all installable scripts into $OUTPUT_FILE
- for f in "${INSTALLED[@]}"
- do
- echo "Adding $f.sh"
- cat "$f.sh" >> $CONFIG_OUTPUT_FILE
- echo "" >> $CONFIG_OUTPUT_FILE
- done
|