cron: autogen git_projects

This commit is contained in:
lelgenio 2021-06-15 03:11:51 -03:00
parent ecf26dbce3
commit dc1fca1ec6
3 changed files with 29 additions and 0 deletions

View File

@ -259,6 +259,7 @@ actions:
make_theme: _make_theme
install_meta: install_meta
filter_backgrounds: _backgrouds_filter
git_projects: _git_projects
###############################################################
dotfiles: # Just a bunch of paths and action mappings
@ -381,6 +382,7 @@ dotfiles: # Just a bunch of paths and action mappings
dst: ~/.local/share/crontab
actions:
- crontab_install
- git_projects
theme:
src: theme

View File

@ -7,6 +7,7 @@ PATH={{@@ env['PATH'] @@}}
*/5 * * * * checkmail update
*/5 * * * * vdirsyncer sync
*/30 * * * * savegame_backup
30 * * * * _git_projects
# {%@@ endif @@%} #
# vim: commentstring=#\ %s

26
dotfiles/scripts/_git_projects Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
set -x
projdir="${HOME}/Projects"
user="{{@@ mail.personal.user @@}}"
host="git.{{@@ mail.personal.mail @@}}"
#{%@@ if False @@%}#
user="$USER"
host="github.com"
#{%@@ endif @@%}#
if ! git -C "$projdir" rev-parse > /dev/null
then
git clone "ssh://git@${host}:${user}/projects" "$projdir"
cd "$projdir"
git submodule update --init --recursive
fi
cd "$projdir"
git submodule foreach --recursive sh -c 'git pull &'