bootstrap/bootstrap-user.sh

23 lines
862 B
Bash
Executable file

#! /bin/bash
# SPDX-FileCopyrightText: 2023 Tobias Schmidl
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# fail immediately on error
set -e
TMPDIR=$(mktemp -u -p "$HOME" -d dotfiles.XXXXX) && \
git clone --separate-git-dir="$HOME/.cfg" https://git.schmidl.dev/schtobia/dotfiles.git "$TMPDIR" && \
[ -r "$TMPDIR/.gitmodules" ] && cp -vi "$TMPDIR/.gitmodules" "$HOME"
[ -d "$HOME/.cfg" ] && \
git --git-dir="$HOME/.cfg/" --work-tree="$HOME" config status.showUntrackedFiles no && \
(cd "$HOME" && \
git --git-dir="$HOME/.cfg/" --work-tree="$HOME" checkout -- . && \
git --git-dir="$HOME/.cfg/" --work-tree="$HOME" submodule update --init --remote --recursive --rebase)
rm -rf "$TMPDIR"
pip install --user -r https://git.schmidl.dev/schtobia/bootstrap/raw/branch/master/requirements.txt &&
# vim related
nvim +PluginInstall +UpdateRemotePlugins +qall