#!/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 ."