summaryrefslogtreecommitdiff
path: root/script.sh
diff options
context:
space:
mode:
authorChristian Segundo2023-11-19 16:21:29 +0100
committerChristian Segundo2023-11-19 16:21:29 +0100
commitc6845a798c99e96aa0e2f6daece0684a8ac50681 (patch)
treea75eec68984bcb7ff8f8c5f048b4806d5cb4ff5a /script.sh
parentd880836621f0b4b4ca036e62e34d6edc74b61e81 (diff)
downloadmoz-run-this-page-action-c6845a798c99e96aa0e2f6daece0684a8ac50681.tar.gz
wip
Diffstat (limited to 'script.sh')
-rwxr-xr-xscript.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/script.sh b/script.sh
new file mode 100755
index 0000000..690a06d
--- /dev/null
+++ b/script.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+GIT_HTTPS_URL="$1"
+
+cat /dev/null > /Users/christian.segundo/git/moz-glab-local-edit/log
+echo "Received URL: $GIT_HTTPS_URL" >> /Users/christian.segundo/git/moz-glab-local-edit/log
+repo_path=$(echo "$GIT_HTTPS_URL" | sed -E 's/https\+vim:\/\/gitlab.otters.xyz\/(.*)\/-\/.*/\1/')
+echo "Repo Path: $repo_path" >> /Users/christian.segundo/git/moz-glab-local-edit/log
+# if the path exists in ~/git/Cabify
+if [ -d "/Users/christian.segundo/git/Cabify/$repo_path" ]; then
+ echo "Repo exists in local" >> /Users/christian.segundo/git/moz-glab-local-edit/log
+else
+ echo "Repo doesn't exists in local" >> /Users/christian.segundo/git/moz-glab-local-edit/log
+fi
+
+# open vim in the 0 tmux sessions in a new tab
+tmux new-window -t 0 -n "$repo_path" "cd ~/git/Cabify/$repo_path && nvim ."