-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdatecode
More file actions
30 lines (26 loc) · 872 Bytes
/
updatecode
File metadata and controls
30 lines (26 loc) · 872 Bytes
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
#!/bin/bash
# the following git repos will be installed
# and updated on this computer
repos=("https://github.com/arialdomartini/oh-my-git" "https://github.com/sg-s/srinivas.gs_mtools" "https://github.com/sg-s/xolotl" "https://github.com/sg-s/crabsort" "https://github.com/sg-s/cpplab" "https://github.com/sg-s/neuron-db" "https://github.com/sg-s/condalab" "https://github.com/sg-s/data")
# make code directory and get code
if [ ! -d "$HOME/code/" ]
then
echo "making code directory..."
mkdir "$HOME"/code/
fi
for repo in "${repos[@]}"
do
repo_name=$(basename "$repo")
if [ ! -d "$HOME/code/$repo_name" ]; then
echo -n "Installing " "$repo_name"
cd "$HOME"/code/ || exit
git clone "$repo" -q
else
echo -n "Updating" "$repo_name"
cd "$HOME"/code/"$repo_name" || exit
git stash -q
git checkout master -q
git pull -q
fi
echo " DONE"
done