forked from evolix/ansible-roles
ansible-log: detect git dir
This commit is contained in:
parent
18511c6fba
commit
399613c06a
|
@ -7,12 +7,17 @@ ppppid=$(ps -p "$pppid" -o ppid=)
|
|||
ps --pid "$ppppid" -o command=
|
||||
echo ""
|
||||
|
||||
git config --get remote.origin.url
|
||||
git log --pretty="%h - %s" -3
|
||||
if [ -d .git ]; then
|
||||
git config --get remote.origin.url
|
||||
git log --pretty="%h - %s" -3
|
||||
fi
|
||||
|
||||
ansible_cfg=$(ansible --version|grep "config file"|awk -F'=' '{print $2}'|xargs)
|
||||
roles_path=$(grep "roles_path" $ansible_cfg|awk -F'=' '{print $2}'|sed "s|~|$HOME|"|xargs)
|
||||
|
||||
echo ""
|
||||
git -C $roles_path config --get remote.origin.url
|
||||
git -C $roles_path log --pretty="%h - %s" -3
|
||||
find $roles_path -type d -name .git|while read git; do
|
||||
git=$(basename "$git")
|
||||
echo ""
|
||||
git -C $roles_path config --get remote.origin.url
|
||||
git -C $roles_path log --pretty="%h - %s" -3
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue