diff --git a/utils/copy_hooks.sh b/utils/copy_hooks.sh index b27313e780bacf5c6811be42736abc3694cca132..f5bed2f2552ef3440e7e9589197c0922a1875927 100755 --- a/utils/copy_hooks.sh +++ b/utils/copy_hooks.sh @@ -7,9 +7,8 @@ # -if [ "post-merge" ]; then +if [ -d "githooks" ]; then if [ -d "../.git/hooks" ]; then - cp -f post-merge ../.git/hooks/post-merge - cp -f pre-push ../.git/hooks/pre-push + cp -f githooks/* ../.git/hooks/ fi fi diff --git a/utils/pre-push b/utils/githooks/post-merge similarity index 55% rename from utils/pre-push rename to utils/githooks/post-merge index cb67b173faed285245212f563e13d243868438b7..548e6ae56f6a55c2d1acab88308e336c06e71616 100755 --- a/utils/pre-push +++ b/utils/githooks/post-merge @@ -1,6 +1,6 @@ #!/bin/sh # -# Hook qui permet de mettre à jour toutes les dépendances +# Hook qui permet de pull toutes les dépendances # quand on fait un pull sur l'application # # @@ -8,7 +8,8 @@ # # -echo "****** Pre-push Hook ******" +echo "****** Post-merge Hook ******" +echo "****** Pull subtrees ******" echo "$(pwd)" if [ -d "$(pwd)/utils" ]; then diff --git a/utils/githooks/pre-push b/utils/githooks/pre-push new file mode 100755 index 0000000000000000000000000000000000000000..50401f9e2df8033763628124e1445afe66e9bad5 --- /dev/null +++ b/utils/githooks/pre-push @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Hook qui permet de push toutes les dépendances +# quand on fait un push sur l'application +# +# +# +# +# + +remote="$1" +url="$2" +if [ $remote != $url ]; then + + echo "****** Pre-push Hook ******" + echo "****** Push subtrees ******" + if [ -d "$(pwd)/utils" ]; then + cd utils + ./push_subtrees.sh + fi +fi diff --git a/utils/post-merge b/utils/post-merge deleted file mode 100755 index eaedfb0b7bab3c87d565f16b1d04e72c6248c5bc..0000000000000000000000000000000000000000 --- a/utils/post-merge +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# -# Hook qui permet de push toutes les dépendances -# quand on fait un push sur l'application -# -# -# -# -# - -echo "****** Post-merge Hook ******" -echo "$(pwd)" - -if [ -d "$(pwd)/utils" ]; then - cd utils - ./push_subtrees.sh -fi