install: make install_rust_app
This commit is contained in:
35
install
35
install
@@ -5,6 +5,24 @@
|
|||||||
|
|
||||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
|
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)
|
BASE=$(pwd)
|
||||||
EXA_VER=
|
EXA_VER=
|
||||||
|
|
||||||
@@ -28,7 +46,16 @@ if [ "$(which cargo)" == "" ] ; then
|
|||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
fi
|
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)
|
GIT=$(which git)
|
||||||
if [ "$GIT" != "" ] ; then
|
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 core.pager "delta --line-numbers --dark"
|
||||||
git config --global delta.side-by-side true
|
git config --global delta.side-by-side true
|
||||||
# git config --global delta.syntax-theme Dracula
|
git config --global delta.syntax-theme Dracula
|
||||||
git config --global delta.syntax-theme "Solarized (dark)"
|
# git config --global delta.syntax-theme "Solarized (dark)"
|
||||||
|
|
||||||
if [ ! -d ~/.tmux/plugins/tpm ] ; then
|
if [ ! -d ~/.tmux/plugins/tpm ] ; then
|
||||||
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||||
@@ -92,4 +119,6 @@ if [ ! -d ~/.tmux/plugins/tpm ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# TODO - install node?
|
||||||
|
|
||||||
./install-vim
|
./install-vim
|
||||||
|
|||||||
Reference in New Issue
Block a user