diff options
Diffstat (limited to 'script.sh')
-rwxr-xr-x | script.sh | 16 |
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 ." |