dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 099f98c8fa7e09cb83bf067a0097cbaccff273c3
parent 5ce7250a6a2a45a8222fab5ba873c85067c84488
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Mon,  5 Feb 2018 19:50:09 -0500

my-init: Add switch to install crontab

Diffstat:
M.local/bin/my-init | 15+++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/.local/bin/my-init b/.local/bin/my-init @@ -4,7 +4,12 @@ # # A place to dump run-once type initializations -vim_bundle_path="$HOME/.vim/pack/bundle" +while [ -n "$1" ] +do + [ "$1" = "-f" ] && force_init=1 + [ "$1" = "-c" ] && crontab_init=1 + shift +done __has() { @@ -39,7 +44,7 @@ __optclone_pathogen() echo "Performing run-once initializations" -if [ -n "$1" -a "$1" = "-f" ] +if [ -n "$force_init" ] then echo " Re-initialization requested" rm -f "$HOME/._.djmoch" @@ -66,14 +71,13 @@ then lesskey fi -if __has "crontab" +if __has "crontab" && [ -n "$crontab_init" ] then echo " Installing crontab" cron_dir="$HOME/.local/lib/cron" log_dir="$HOME/.local/var/log" cat > /tmp/crontab.$$ <<-EOF # m h dom mon dow command - */5 * * * * $cron_dir/weather.sh > $log_dir/weather 2>&1 */15 * * * * PATH="$HOME/.local/bin":$PATH $cron_dir/vdirsyncer.sh > $log_dir/vdirsyncer 2>&1 */15 * * * * $cron_dir/photosync.sh > $log_dir/photosync 2>&1 @@ -85,6 +89,7 @@ EOF fi # Vim plugins +vim_bundle_path="$HOME/.vim/pack/bundle" if __has "vim" "git" && [ ! -d "$vim_bundle_path" ] then echo " Downloading Vim plugins" @@ -117,6 +122,8 @@ then cd $vim_bundle_path/opt __clone jpalardy/vim-slime cd - > /dev/null 2>&1 + + unset vim_bundle_path fi [ ! -d "$HOME/.local/var/log" ] && mkdir -p "$HOME/.local/var/log"