You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync eng/common directory with azure-sdk-tools for PR 6250 (#30581)
* Revert the change and return tsplocation folder
* Out null for the new-item command
* exit if return failure when call sync script
* Added repo assignment in local path scenario
* Added more output
* Fix path processing in windows
* exit when run generate script with error
---------
Co-authored-by: raychen <[email protected]>
Write-Host"updated tsp-location.yaml in $packageDir"
70
+
Write-Host"finished updating tsp-location.yaml in $packageDir"
67
71
return$packageDir
68
72
}
69
73
@@ -87,22 +91,13 @@ function Get-PackageDir([System.Object]$tspConfig) {
87
91
return$packageDir
88
92
}
89
93
90
-
$repo=""
91
-
if ($RepoUrl) {
92
-
if ($RepoUrl-match"^https://github.com/(?<repo>[^/]*/azure-rest-api-specs(-pr)?).*") {
93
-
$repo=$Matches["repo"]
94
-
}
95
-
else {
96
-
Write-Host"Parameter 'RepoUrl' has incorrect value: $RepoUrl. It should be similar like 'https://github.com/Azure/azure-rest-api-specs'"
# example url of tspconfig.yaml: https://github.com/Azure/azure-rest-api-specs-pr/blob/724ccc4d7ef7655c0b4d5c5ac4a5513f19bbef35/specification/containerservice/Fleet.Management/tspconfig.yaml
107
102
if ($TypeSpecProjectDirectory-match'^https://github.com/(?<repo>Azure/azure-rest-api-specs(-pr)?)/blob/(?<commit>[0-9a-f]{40})/(?<path>.*)/tspconfig.yaml$') {
108
103
try {
@@ -119,15 +114,32 @@ if ($TypeSpecProjectDirectory -match '^https://github.com/(?<repo>Azure/azure-re
119
114
$CommitHash=$Matches["commit"]
120
115
# TODO support the branch name in url then get the commithash from branch name
Write-Error"Failed to find tspconfig.yaml in '$TypeSpecProjectDirectory'"
130
+
if (!$CommitHash) {
131
+
Write-Error"Parameter of Commithash is not provided in the local path scenario."
132
+
exit1
133
+
}
134
+
if (!$RepoUrl) {
135
+
Write-Error"Parameter of RepoUrl:$RepoUrl is not provided in the local path scenario."
136
+
exit1
137
+
}
138
+
if ($RepoUrl-match"^https://github.com/(?<repo>[^/]*/azure-rest-api-specs(-pr)?).*") {
139
+
$repo=$Matches["repo"]
140
+
}
141
+
else {
142
+
Write-Error"Parameter 'RepoUrl' has incorrect value:$RepoUrl. It should be similar like 'https://github.com/Azure/azure-rest-api-specs'"
131
143
exit1
132
144
}
133
145
}
@@ -142,6 +154,13 @@ if (Test-Path $tmpTspConfigPath) {
0 commit comments