debian: add lf(1)
This commit is contained in:
parent
9fdcb9e110
commit
6501cd5468
1 changed files with 25 additions and 0 deletions
25
debian.sh
25
debian.sh
|
@ -5,6 +5,7 @@ USERNAME=fernando
|
||||||
DOTFILES_URL="https://github.com/fschauen/dotfiles.git"
|
DOTFILES_URL="https://github.com/fschauen/dotfiles.git"
|
||||||
NEOVIM_VERSION="0.9.1"
|
NEOVIM_VERSION="0.9.1"
|
||||||
GIT_DELTA_VERSION="0.16.5"
|
GIT_DELTA_VERSION="0.16.5"
|
||||||
|
LF_VERSION="r30"
|
||||||
|
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
sgr0="$(printf '\033[0m')"
|
sgr0="$(printf '\033[0m')"
|
||||||
|
@ -128,6 +129,27 @@ install_git_delta() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_lf() {
|
||||||
|
lf_url="https://github.com/gokcehan/lf/releases/download/${LF_VERSION}/lf-linux-amd64.tar.gz"
|
||||||
|
lf_tarball="lf-${LF_VERSION}.tar.gz"
|
||||||
|
lf_package="lf-${LF_VERSION}"
|
||||||
|
lf_install_dir="/usr/local/stow/${lf_package}"
|
||||||
|
|
||||||
|
if [ ! -d "${lf_install_dir}" ]; then
|
||||||
|
# Download the selected tarball and unpack it.
|
||||||
|
[ ! -f "${lf_tarball}" ] && $cmd curl -L -o "${lf_tarball}" "${lf_url}"
|
||||||
|
$cmd tar -xvf "${lf_tarball}"
|
||||||
|
$cmd rm -vf "${lf_tarball}"
|
||||||
|
|
||||||
|
# Stow into `/usr/local`.
|
||||||
|
$cmd mkdir -vp "${lf_install_dir}/bin"
|
||||||
|
$cmd mv -v lf "${lf_install_dir}/bin/lf"
|
||||||
|
$cmd stow -v -d /usr/local/stow -t /usr/local "${lf_package}"
|
||||||
|
else
|
||||||
|
echo "${yellow}SKIPPED:${sgr0} ${lf_install_dir} exists"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
setup_user() {
|
setup_user() {
|
||||||
# Change shell to `zsh` and get rid of bash files.
|
# Change shell to `zsh` and get rid of bash files.
|
||||||
$cmd chsh -s /bin/zsh "$USERNAME"
|
$cmd chsh -s /bin/zsh "$USERNAME"
|
||||||
|
@ -167,6 +189,9 @@ execute() {
|
||||||
heading "Install git-delta v$GIT_DELTA_VERSION"
|
heading "Install git-delta v$GIT_DELTA_VERSION"
|
||||||
install_git_delta
|
install_git_delta
|
||||||
|
|
||||||
|
heading "Install lf v$LF_VERSION"
|
||||||
|
install_lf
|
||||||
|
|
||||||
heading "Setup user: $USERNAME"
|
heading "Setup user: $USERNAME"
|
||||||
setup_user
|
setup_user
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue