-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc-mac
More file actions
128 lines (102 loc) · 2.91 KB
/
.bashrc-mac
File metadata and controls
128 lines (102 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# custom being
gsync() {
if ! git remote | grep -q "^upstream$"; then
echo "Upstream remote not found."
return 1
fi
local default_branch=$(git symbolic-ref HEAD 2>/dev/null | sed -e 's/^refs\/heads\///')
if [ -z "$default_branch" ]; then
default_branch="main"
fi
git checkout "$default_branch" && git fetch upstream && git rebase "upstream/$default_branch" && git push
}
gclone() {
if [ -z "$1" ]; then
echo "Usage: git_clone_code <git_repo_url>"
return 1
fi
mkdir -p ~/code
cd ~/code || return
git clone "$1"
}
gupstream() {
if [ -z "$1" ]; then
echo "Usage: g-upstream <main_repo_url>"
return 1
fi
git remote add upstream "$1"
}
gamend(){
git commit --amend --no-edit -a && git push -f
}
grepo() {
local remote_info=$(git remote get-url origin 2>/dev/null)
if [[ -n "$remote_info" ]]; then
local repo_url="$remote_info"
if [[ "$repo_url" =~ ^git@github\.com:([^/]+)/([^.]+)\.git$ ]]; then
repo_url="https://github.com/${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
elif [[ "$repo_url" =~ ^https?://github\.com/([^/]+)/([^.]+)\.git$ ]]; then
repo_url="${repo_url%.git}"
fi
echo "Opening repository URL in browser: $repo_url"
open "$repo_url"
else
echo "Error: Could not extract the 'origin' repository URL."
return 1
fi
}
# --------------------- CUSTOM REPO SETUP ---------------------
setup-repos(){
gclone git@github.com:0xMALVEE/aistor-console.git
gclone git@github.com:0xMALVEE/eos.git
gclone git@github.com:0xMALVEE/ec.git
gclone git@github.com:0xMALVEE/mc.git
gclone git@github.com:0xMALVEE/minio.git
gclone git@github.com:0xMALVEE/madmin-go.git
gclone git@github.com:0xMALVEE/object-browser.git
gclone git@github.com:0xMALVEE/mds.git
gclone git@github.com:0xMALVEE/minio-go.git
gclone git@github.com:0xMALVEE/pkg.git
gclone git@github.com:0xMALVEE/minkms.git
gclone git@github.com:0xMALVEE/kes.git
cd ~/code/aistor-console
gupstream git@github.com:miniohq/aistor-console.git
gsync
cd ~/code/eos
gupstream git@github.com:miniohq/eos.git
gsync
cd ~/code/ec
gupstream git@github.com:miniohq/ec.git
gsync
cd ~/code/mc
gupstream git@github.com:minio/mc.git
gsync
cd ~/code/minio
gupstream git@github.com:minio/minio.git
gsync
cd ~/code/madmin-go
gupstream git@github.com:minio/madmin-go.git
gsync
cd ~/code/object-browser
gupstream git@github.com:minio/object-browser.git
gsync
cd ~/code/minio-go
gupstream git@github.com:minio/minio-go.git
gsync
cd ~/code/mds
gupstream git@github.com:miniohq/mds.git
gsync
cd ~/code/pkg
gupstream git@github.com:minio/pkg.git
gsync
cd ~/code/minkms
gupstream git@github.com:miniohq/minkms.git
gsync
cd ~/code/kes
gupstream git@github.com:miniohq/kes.git
gsync
}
export NPM_USERNAME="$(< ~/minio/npm.user)"
export NPM_PASSWORD="$(< ~/minio/npm.pass)"
export MINIO_LICENSE="$(< ~/minio/minio.license)"
# custom end