From 7e567144bce8d08e41d51a842fb550a68c99c91e Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Tue, 2 Feb 2021 17:29:50 +0000 Subject: [PATCH] install: make install_rust_app --- install | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/install b/install index 789d870..e948585 100755 --- a/install +++ b/install @@ -5,6 +5,24 @@ cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1 +install_rust_app() { + REPO=$1 + DIRNAME=$2 + BINARY=$3 + + if [ ! -d "$DIRNAME" ] ; then + git clone "$REPO" "$DIRNAME" + pushd "$DIRNAME" 1>/dev/null + else + pushd "$DIRNAME" 1>/dev/null + git pull + fi + cargo build --release + cp -fv $PWD/target/release/$BINARY ~/bin/ + cargo clean + popd 1>/dev/null +} + BASE=$(pwd) EXA_VER= @@ -28,7 +46,16 @@ if [ "$(which cargo)" == "" ] ; then source $HOME/.cargo/env fi -cargo install delta bat exa sd +cargo install bat exa sd + +GIT=$(which git) +if [ "$GIT" != "" ] ; then + mkdir -p ~/src/ + install_rust_app https://github.com/sharkdp/fd.git ~/src/fd fd + install_rust_app https://github.com/dandavison/delta.git ~/src/delta delta +else + echo "You don't have git; can't install fd and a lot of Vim plugins are going to fail too." +fi GIT=$(which git) if [ "$GIT" != "" ] ; then @@ -81,8 +108,8 @@ git config --global user.name "Paul Walker" git config --global core.pager "delta --line-numbers --dark" git config --global delta.side-by-side true -# git config --global delta.syntax-theme Dracula -git config --global delta.syntax-theme "Solarized (dark)" +git config --global delta.syntax-theme Dracula +# git config --global delta.syntax-theme "Solarized (dark)" if [ ! -d ~/.tmux/plugins/tpm ] ; then git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm @@ -92,4 +119,6 @@ if [ ! -d ~/.tmux/plugins/tpm ] ; then fi fi +# TODO - install node? + ./install-vim