dotfiles/common.sh
2024-04-26 22:34:29 +02:00

41 lines
664 B
Bash

#!/usr/bin/env bash
REPO_DIR=$(dirname $(readlink -f $0))
HOME_DIR=${HOME}
echo_header() {
bold=$(tput bold)
normal=$(tput sgr0)
red=$(tput setaf 1)
echo "${bold}${red}$1${normal}"
}
workspace_link() {
mkdir -p $(dirname $HOME_DIR/$2)
rm $HOME_DIR/$2 || true
ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true
}
GUI=NO
ENVIRONMENT=personal
while [[ $# -gt 0 ]]; do
case $1 in
--env)
ENVIRONMENT=$2
shift # past argument
shift # past value
;;
--gui)
GUI=YES
shift # past argument
;;
-h | --help)
echo "Usage: install.sh [--gui]"
exit 0
;;
-* | --*)
echo "Unknown option $1"
exit 1
;;
esac
done