nithin varghese commited on
Commit
d8f9bd2
·
unverified ·
2 Parent(s): 311adc3a7a6a0f

Merge pull request #1 from humandotlearning/add-pre-push-hook

Browse files
Files changed (1) hide show
  1. githooks/pre-push +19 -0
githooks/pre-push ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ remote="$1"
4
+ url="$2"
5
+
6
+ # Avoid infinite recursion if the push is already to 'hf'
7
+ if [ "$remote" = "hf" ]; then
8
+ exit 0
9
+ fi
10
+
11
+ # Check if 'hf' remote exists
12
+ if git remote | grep -q "^hf$"; then
13
+ echo "Pushing to Hugging Face Space..."
14
+ git push hf main
15
+ else
16
+ echo "Remote 'hf' not found. Skipping push to Hugging Face Space."
17
+ fi
18
+
19
+ exit 0