diff --git a/install.sh b/install.sh index d1a041c..0fe7573 100755 --- a/install.sh +++ b/install.sh @@ -14,9 +14,10 @@ USAGE OPTIONS -h, --help Display this help message. + -y --yes Skip confirmations. --symlink Symlink the files. This is the default behavior. --copy Copy the files. - --noscript Skip the post-install script + --noscript Skip the pre-install and the post-install scripts EOF } @@ -99,11 +100,6 @@ make_link() { fi } -post_install() { - # install vim plugins - vim -E +"call dein#update()" +"qall!" /dev/null &>/dev/null -} - short_args=hy long_args=help,yes,symlink,copy,noscript @@ -154,6 +150,11 @@ fi pushd "${0%/*}" >/dev/null +if [[ -f "./scripts/pre-install.sh" && -z "$OPT_NOSCRIPT" ]]; then + log "*" "Running pre-install" + bash ./scripts/pre-install.sh +fi + for file_source in "files"; do log "*" "Processing $file_source" for file_path in $(get_path "$file_source"); do @@ -161,9 +162,9 @@ for file_source in "files"; do done done -if [[ -z "$OPT_NOSCRIPT" ]]; then +if [[ -f "./scripts/post-install.sh" && -z "$OPT_NOSCRIPT" ]]; then log "*" "Running post-install" - post_install + bash ./scripts/post-install.sh fi popd >/dev/null diff --git a/scripts/post-install.sh b/scripts/post-install.sh new file mode 100644 index 0000000..c525b97 --- /dev/null +++ b/scripts/post-install.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# install vim plugins +vim -E +"call dein#update()" +"qall!" /dev/null &>/dev/null +