dev-scripts/scripts/install-dev-env.sh

61 lines
2.9 KiB
Bash
Raw Normal View History

2020-12-30 16:26:41 +00:00
#!/bin/sh
_user="www-data"
_home_dir="/home/$_user"
echo "Installing packages .."
export DEBIAN_FRONTEND=noninteractive
echo "Installing packages .."
apt-get -qq -y install curl gnupg2 ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip python-pip python3-pip fzf vim ctags git
echo "----------------------------------------------------------------------------"
echo "Installing lazygit .."
curl -fsSL https://github.com/jesseduffield/lazygit/releases/download/v0.22.1/lazygit_0.22.1_Linux_x86_64.tar.gz --output /tmp/lazygit.tar.gz
tar xf /tmp/lazygit.tar.gz -C /usr/local/bin/
rm -v /tmp/lazygit.tar.gz
echo "----------------------------------------------------------------------------"
echo "Installing lf ..."
curl -fsSL https://github.com/gokcehan/lf/releases/download/r16/lf-linux-amd64.tar.gz --output /tmp/lf.tar.gz
tar xf /tmp/lf.tar.gz -C /usr/local/bin/
rm -v /tmp/lf.tar.gz
echo "----------------------------------------------------------------------------"
echo "Installing neovim ..."
git clone https://github.com/neovim/neovim /tmp/neovim
cd /tmp/neovim
make -s CMAKE_BUILD_TYPE=Release
make -s install
if command -v php ; then
echo "Installing composer .."
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "if (hash_file('sha384', 'composer-setup.php') === '8a6138e2a05a8c28539c9f0fb361159823655d7ad2deecb371b04a83966c61223adc522b0189079e3e9e277cd72b8897') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --filename=composer --install-dir=/usr/local/bin
php -r "unlink('composer-setup.php');"
fi
echo "----------------------------------------------------------------------------"
echo "Installing nvm ..."
su --login "$_user" -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash'
echo 'export NVM_DIR="$HOME/.nvm"' >> "$_home_dir/.profile"
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> "$_home_dir/.profile"
su --login "$_user" -c 'nvm install --lts --latest-npm'
echo "----------------------------------------------------------------------------"
echo "Configuring neovim ..."
su --login "$_user" -c 'npm install -g neovim \
&& python2 -m pip install --user --upgrade pynvim \
&& python3 -m pip install --user --upgrade pynvim \
&& python3 -m pip install --user --upgrade neovim-remote'
su --login "$_user" -c 'git clone https://git.rayelliott.dev/dots/nvim.git "$HOME"/.config/nvim \
&& curl -fLo "$HOME"/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \
&& nvim --headless +PlugInstall +qall'
echo "----------------------------------------------------------------------------"
echo "Configuring lf .."
su --login "$_user" -c 'git clone https://git.rayelliott.dev/dots/lf.git "$HOME"/.config/lf'