-
-
Notifications
You must be signed in to change notification settings - Fork 177
Expand file tree
/
Copy pathupdate-go
More file actions
executable file
·42 lines (32 loc) · 698 Bytes
/
update-go
File metadata and controls
executable file
·42 lines (32 loc) · 698 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
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env sh
set -e
# Print the usage when none arguments are provided.
if [ "$#" -eq 0 ]; then
cat <<EOF
Updates the Go version of the project to <version>.
Usage:
$0 <version>
Examples:
$0 1.21
EOF
exit 0
fi
. "$(dirname "$0")/utils"
version=$1
directories=(
"" # Parent path
"api"
"cli"
"ssh"
"agent"
"tests"
)
for dir in "${directories[@]}"; do
abs_path="$SHELLHUB_PATH/$dir"
echo "Processing directory: $abs_path"
cd "$abs_path" || { echo "Failed to enter directory $abs_path"; exit 1; }
go mod edit -go=$version
go mod tidy
echo "Completed processing directory: $abs_path"
done
echo "Script execution completed."