dotfiles

Cem's Dotfiles
git clone git://git.ckyln.com/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit ca3a5a35309b858838d5482945cde9cda038688f
parent b693bd6fcd5c2f6997a8178a5eacc48980ae7341
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri,  8 Nov 2019 10:45:29 +0300

switch to shell

Diffstat:
M.local/bin/updot | 43+++++++++++++++++++------------------------
1 file changed, 19 insertions(+), 24 deletions(-)

diff --git a/.local/bin/updot b/.local/bin/updot @@ -1,10 +1,8 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh -out() { printf "$1 $2\n" "${@:3}"; } -error() { out "==> ERROR:" "$@"; } >&2 -warning() { out "==> WARNING:" "$@"; } >&2 -msg() { out "==>" "$@"; } -msg2() { out " ->" "$@";} +out() { printf "$@\\n" ;} +error() { out "ERROR: $@" ; } >&2 +msg() { out "==> $@" ; } die() { error "$@"; exit 1; } usage() { @@ -69,35 +67,35 @@ before you continue. EOF printf "Proceed? (y/N) " read ans -[ "$ans" = "y" ] || die 'User exited' +[ "$ans" = "y" ] || die "User exited" } makeinstall() { cd /tmp dir="$(mktemp -d)" - git clone $1 $dir || die 'Could not clone git repo' + git clone $1 $dir || die "Could not clone git repo" cd $dir - make || die 'Could not build %s' "$1" - sudo make install || die 'Could not install %s' "$1" + make || die "Could not build $1" + sudo make install || die "Could not install $1" } installcsv() {\ - [ -e $progs ] || die 'Could not retrieve progs.csv' + [ -e $progs ] || die "Could not retrieve progs.csv" while IFS=, read -r src name do case $src in y) - out 'Installing %s' "$name" - yay -S --noconfirm --needed $name >/dev/null || die 'Could not install %s' "$name" - msg 'Installed %s' "$name" ;; + out "Installing $name" + yay -S --noconfirm --needed $name >/dev/null || die "Could not install $name" + msg "Installed $name" ;; g) - out 'Installing %s' "$name" - makeinstall $name || die 'Could not install %s' "$name" - msg 'Installed %s' "$name" ;; + out "Installing $name" + makeinstall $name || die "Could not install $name" + msg "Installed $name" ;; *) - out 'Installing %s' "$name" - sudo pacman -S --noconfirm --needed $name >/dev/null || die 'Could not install %s' "$name" - msg 'Installed %s' "$name" ;; + out "Installing $name" + sudo pacman -S --noconfirm --needed $name >/dev/null || die "Could not install $name" + msg "Installed $name" ;; esac done < $progs } @@ -111,10 +109,7 @@ dotfilesinstall() { } finalize() { - cat <<EOF -Carbs update script is finished - -EOF +printf "Carbs update script is finished\\n\\n" } welcomepage