Create a script to git-sync all current projects
This commit is contained in:
parent
cb1435a7e0
commit
c3795ab35b
1 changed files with 23 additions and 0 deletions
23
.local/bin/sync-git-repos
Executable file
23
.local/bin/sync-git-repos
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#! /usr/bin/sh
|
||||||
|
|
||||||
|
REPO_ROOT_FILE="$(systemd-path user-state-private)"/repo-roots/repo-roots
|
||||||
|
|
||||||
|
list_repos () {
|
||||||
|
repo_root=$1
|
||||||
|
|
||||||
|
find "${repo_root}" -maxdepth 2 -name .git -type d -exec dirname {} \;
|
||||||
|
}
|
||||||
|
|
||||||
|
sync_repo () {
|
||||||
|
repo=$1
|
||||||
|
|
||||||
|
echo git-sync "${repo}"
|
||||||
|
git-sync "${repo}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
while read -r repo_root; do
|
||||||
|
for repo in $(list_repos "${repo_root}"); do
|
||||||
|
sync_repo "${repo}"
|
||||||
|
done
|
||||||
|
done < "${REPO_ROOT_FILE}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue