summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/in-git-repo9
1 files changed, 9 insertions, 0 deletions
diff --git a/.local/bin/in-git-repo b/.local/bin/in-git-repo
new file mode 100755
index 0000000..e155bc8
--- /dev/null
+++ b/.local/bin/in-git-repo
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+res=$(git rev-parse --is-inside-work-tree 2>/dev/null)
+
+if [[ $res == true ]]; then
+ exit 0
+else
+ exit 1
+fi