diff --git a/.gitignore b/.gitignore index 51fc687c..7975b3fd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ *.swp .python-version .DS_Store -plugin/ - -venv \ No newline at end of file +# For Packer plugins +plugin +# For lazygit state file +state.yml +# For pynvim environment +venv diff --git a/install.sh b/install.sh index 6adad2cf..5bb6f033 100755 --- a/install.sh +++ b/install.sh @@ -1,14 +1,38 @@ #! /usr/bin/env sh # Install various dotfiles into their proper places +# Get machine for specific config locations +unameOut="$(uname -s)" +case "${unameOut}" in + Linux*) machine=Linux;; + Darwin*) machine=Mac;; + CYGWIN*) machine=Cygwin;; + MINGW*) machine=MinGw;; + *) machine="UNKNOWN:${unameOut}" +esac +echo "Machine: ${machine}" + # .config files CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" mkdir -p "$CONFIG_DIR" for FILE in config/*; do FILENAME="$(basename $FILE)" - if [ ! -e "$CONFIG_DIR/$FILENAME" ]; then + if [ ! -e "$CONFIG_DIR/$FILENAME" ] + then ln -s $(readlink -f "$FILE") "$CONFIG_DIR/$FILENAME" + echo "$(readlink -f $FILE) -> $CONFIG_DIR/$FILENAME" fi - echo "$(readlink -f $FILE) -> $CONFIG_DIR/$FILENAME" done + +# Mac specific lazygit setup (because of course) +if [ $machine == "Mac" ] +then + rm "$CONFIG_DIR/lazygit" + echo "Removed $CONFIG_DIR/lazygit" + if [ ! -e "$HOME/Library/Application Support/lazygit" ] + then + ln -s "$(readlink -f config/lazygit)" "$HOME/Library/Application Support/lazygit" + echo "$(readlink -f config/lazygit) -> $HOME/Library/Application Support/lazygit" + fi +fi