-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-update.sh
More file actions
executable file
·37 lines (33 loc) · 1.02 KB
/
git-update.sh
File metadata and controls
executable file
·37 lines (33 loc) · 1.02 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
#!/bin/bash
odir=${CHESS_DIR:-$PWD}
echo "CHESS directory: $odir"
cd $odir
# processes
services="Authz MetaData UserMetaData DataDiscovery DataManagement DataBookkeeping Frontend SyncService SpecScansService MLHub DataHub DOIService ClasseInfoService"
# add all gotools subdirectories dynamically
for tool in gotools/*; do
[ -d "$tool" ] && services="$services $tool"
done
for srv in $services
do
echo
echo "### visit $srv service..."
cd "$srv" || { echo "Cannot enter $srv"; continue; }
if [ ! -f go.mod ]; then
echo "No go.mod found in $srv, skipping..."
cd - >/dev/null 2>&1
continue
fi
rm go.mod go.sum
go mod init github.com/CHESSComputing/$srv
go mod tidy
echo >> go.mod
# determine correct relative path to golib
if [[ "$srv" == gotools/* ]]; then
echo "replace github.com/CHESSComputing/golib => ../../golib" >> go.mod
else
echo "replace github.com/CHESSComputing/golib => ../golib" >> go.mod
fi
git status
cd - 2>&1 1>& /dev/null
done