install: make install_rust_app

This commit is contained in:
2021-02-02 17:29:50 +00:00
parent 15b5499ab6
commit 7e567144bc

35
install
View File

@@ -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