From c6845a798c99e96aa0e2f6daece0684a8ac50681 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 19 Nov 2023 16:21:29 +0100 Subject: wip --- script.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 script.sh (limited to 'script.sh') 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 ." -- cgit v1.2.3