Révision 1c1c5a42
Ajouté par Julien Enselme il y a plus de 10 ans
bin/scripts-utils.sh | ||
---|---|---|
76 | 76 |
settings_location=`realpath $1` |
77 | 77 |
echo `dirname $settings_location` |
78 | 78 |
} |
79 |
|
|
80 |
work_tree_clean() { |
|
81 |
git_status_output=`git status --porcelain` |
|
82 |
if [ -z $git_status_output ] ; then |
|
83 |
exit 0 |
|
84 |
else |
|
85 |
exit 1 |
|
86 |
fi |
|
87 |
} |
|
88 |
|
|
89 |
mail_unclean_work_tree() { |
|
90 |
cd $dir_multi_assos |
|
91 |
git_status_output=`git status` |
|
92 |
echo $git_status_output | mail -s $1 $email_multi_assos |
|
93 |
} |
|
94 |
|
|
95 |
commit_if_unclean() { |
|
96 |
if ! work_tree_clean ; then |
|
97 |
commit_message="COMMIT OF UNCLEAN STUFF" |
|
98 |
commit -a -m $commit_message |
|
99 |
mail_unclean_work_tree "[git] $commit_message" |
|
100 |
fi |
|
101 |
} |
|
102 |
|
|
103 |
commit() { |
|
104 |
# ARG: commit message |
|
105 |
if [ -z $1 ] ; then |
|
106 |
echo "Empty commit message. Nothing was commited." |
|
107 |
exit 2 |
|
108 |
fi |
|
109 |
cd $dir_multi_assos |
|
110 |
git commit -a -m $1 |
|
111 |
} |
Formats disponibles : Unified diff
Script support git as described #343 to implement #191