blob: 690a06db665174b91d7e7762d2eb63aff52f8758 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 ."
|