Compare commits
1 commit
1b278acd2b
...
0dfd2abfd5
| Author | SHA1 | Date | |
|---|---|---|---|
| 0dfd2abfd5 |
1 changed files with 23 additions and 13 deletions
|
|
@ -1,4 +1,7 @@
|
||||||
#! /usr/bin/sh
|
#! /usr/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
REPO_ROOT_FILE="$(systemd-path user-state-private)"/repo-roots/repo-roots
|
REPO_ROOT_FILE="$(systemd-path user-state-private)"/repo-roots/repo-roots
|
||||||
|
|
||||||
|
|
@ -12,18 +15,25 @@ sync_repo () {
|
||||||
repo=$1
|
repo=$1
|
||||||
|
|
||||||
echo git-sync "${repo}"
|
echo git-sync "${repo}"
|
||||||
( cd "${repo}" && "$(systemd-path user-state-private)"/git-sync/git-sync sync )
|
( cd "${repo}" && "$(systemd-path user-state-private)"/git-sync/git-sync sync ) || true
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "list" = "$1" ]; then
|
case "${1:-sync}" in
|
||||||
while read -r repo_root; do
|
"list")
|
||||||
list_repos "${repo_root}"
|
while read -r repo_root; do
|
||||||
done < "${REPO_ROOT_FILE}"
|
list_repos "${repo_root}"
|
||||||
else
|
done < "${REPO_ROOT_FILE}"
|
||||||
while read -r repo_root; do
|
;;
|
||||||
for repo in $(list_repos "${repo_root}"); do
|
"sync")
|
||||||
sync_repo "${repo}"
|
while read -r repo_root; do
|
||||||
done
|
for repo in $(list_repos "${repo_root}"); do
|
||||||
done < "${REPO_ROOT_FILE}"
|
sync_repo "${repo}"
|
||||||
fi
|
done
|
||||||
|
done < "${REPO_ROOT_FILE}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo Unknown option \""$1"\"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue