add owner/group support to __git
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
ad1f0f77b8
commit
3167ececc6
2 changed files with 20 additions and 3 deletions
|
@ -26,7 +26,22 @@ __package git --state present
|
|||
state_should=present
|
||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
|
||||
|
||||
[ -f "$__object/parameter/owner" ] && dirparams="$dirparams --owner $(cat "$__object/parameter/owner")"
|
||||
[ -f "$__object/parameter/group" ] && dirparams="$dirparams --group $(cat "$__object/parameter/group")"
|
||||
|
||||
# Let __directory handle removal of git repos
|
||||
if [ "$state_should" = absent ]; then
|
||||
__directory "$__object_id" --state absent
|
||||
fi
|
||||
|
||||
case "$state_should" in
|
||||
present)
|
||||
__directory "$__object_id" --state present $dirparams --recursive
|
||||
;;
|
||||
|
||||
absent)
|
||||
__directory "$__object_id" --state absent
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown state: $state_should" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
state
|
||||
branch
|
||||
group
|
||||
owner
|
||||
|
|
Loading…
Reference in a new issue