forked from hashicorp/go-azure-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate-go-get.sh
executable file
·48 lines (35 loc) · 1.13 KB
/
validate-go-get.sh
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
#!/bin/bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
set -e
mkdir -p ./tmp/go-get
cd ./tmp/go-get
echo 'package main
import _ "github.com/hashicorp/go-azure-sdk/microsoft-graph/applications"
import _ "github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview/tenants"
import _ "github.com/hashicorp/go-azure-sdk/sdk/environments"
func main() {
}
' > main.go
echo "module github.com/some/fake-repo
replace github.com/hashicorp/go-azure-sdk/microsoft-graph => ../../microsoft-graph
replace github.com/hashicorp/go-azure-sdk/resource-manager => ../../resource-manager
replace github.com/hashicorp/go-azure-sdk/sdk => ../../sdk
go 1.21
" > go.mod
# Update the Base Layer
go get github.com/hashicorp/go-azure-sdk/sdk@latest
# Update the Microsoft Graph SDK
go get github.com/hashicorp/go-azure-sdk/microsoft-graph@latest
# Update the Resource Manager SDK
go get github.com/hashicorp/go-azure-sdk/resource-manager@latest
if [[ ! $(go mod tidy) -eq 0 ]]; then
echo "Go Mod Tidy failed"
exit 1
fi
if [[ ! $(go mod vendor) -eq 0 ]]; then
echo "Go Mod vendor failed"
exit 1
fi
cd ../../
rm -rf ./tmp