From 99c2410e0ebb98e706c18d1595c33d3f0d576284 Mon Sep 17 00:00:00 2001 From: lhark Date: Sat, 1 Jun 2019 14:34:05 -0400 Subject: [PATCH] Cleanup install script and add XDG_DATA_HOME folder --- data/splatmoji/emotes.tsv | 3 +++ install.sh | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 data/splatmoji/emotes.tsv diff --git a/data/splatmoji/emotes.tsv b/data/splatmoji/emotes.tsv new file mode 100644 index 0000000..27480f8 --- /dev/null +++ b/data/splatmoji/emotes.tsv @@ -0,0 +1,3 @@ +¯\_(ツ)_/¯ whatever, shrug +¯\\_(ツ)_/¯ whatever, shrug +✽-(ˆ▽ˆ)/✽ cheerleader, pom-pom diff --git a/install.sh b/install.sh index ea84008..189abd5 100755 --- a/install.sh +++ b/install.sh @@ -4,10 +4,12 @@ SCRIPT=$(readlink -f "$0") RC_PATH=$(dirname "$SCRIPT") HOST=$(hostname) XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} +XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} # List of the config files to install FILES="vimrc zshrc gitconfig vim gitignore_global git_user ctags.d" CONF_DIR="config" +DATA_DIR="data" if [ ! -e "$HOME/.git_user" ]; then cp "$RC_PATH/git_user.def" "$RC_PATH/git_user" @@ -16,9 +18,9 @@ if [ ! -e "$HOME/.git_user" ]; then fi # Init or update submodules -cd "$RC_PATH" +cd "$RC_PATH" || exit git submodule update --init --recursive -cd - > /dev/null +cd - > /dev/null || exit # Setup fast-syntax-highlighting theme customization cp "$RC_PATH/fsh_theme.zsh" "$RC_PATH/fast-syntax-highlighting/current_theme.zsh" @@ -34,6 +36,10 @@ do fi done -mkdir -p $XDG_CONFIG_HOME -find $RC_PATH/$CONF_DIR -mindepth 1 -maxdepth 1 -type d \ - -exec sh -c "ln -s -t \"$XDG_CONFIG_HOME\" \"{}\" 2> /dev/null || ( link=$XDG_CONFIG_HOME/"'$(basename "{}")'"; test -L "'$link'" || >&2 echo \"Folder "'$link'" exists. Keeping old version.\")" \; +mkdir -p "$XDG_CONFIG_HOME" +mkdir -p "$XDG_DATA_HOME" +# https://github.com/koalaman/shellcheck/wiki/SC2156 +find "$RC_PATH/$CONF_DIR" -mindepth 1 -maxdepth 1 -type d \ + -exec sh -c 'ln -s -t "$1" "$2" 2> /dev/null || ( link="$1/$(basename "$2")"; test -L "$link" || >&2 echo "Folder $link exists. Keeping old version.")' _ "$XDG_CONFIG_HOME" '{}' \; +find "$RC_PATH/$DATA_DIR" -mindepth 1 -maxdepth 1 -type d \ + -exec sh -c 'ln -s -t "$1" "$2" 2> /dev/null || ( link="$1/$(basename "$2")"; test -L "$link" || >&2 echo "Folder $link exists. Keeping old version.")' _ "$XDG_DATA_HOME" '{}' \;