Skip to content

Commit d62b94d

Browse files
asilvermanAriel Silverman
andauthored
CodeFix: Remove relative path prefix from types loading (#12026)
## Description The current implementation makes the wrong assumption that the key names indexed in the types cache have a prefix `./`. This was the case when I was using a dev artifact since the publishing logic wasn't ready. Now that we have a publishing logic for the types package we can fix the code so that it doesn't assume the `./` prefix is found in the files as proven by https://github.com/Azure/bicep-types-az/actions/runs/6398352791/job/17368317634. This PR should be merged before Azure/bicep-types-az#1553, and Azure/bicep-types-az#1553 should be updated to download the latest build from the `main` branch. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/12026) --------- Co-authored-by: Ariel Silverman <[email protected]>
1 parent 3b5f245 commit d62b94d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.vscode/launch.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
"build",
3333
"${file}"
3434
],
35-
"env": {
36-
"BICEP_TRACING_ENABLED": "true",
37-
// "BICEP_REGISTRY_FQDN": "your-registry-here.azurecr.io"
38-
},
35+
"env": {
36+
"BICEP_TRACING_ENABLED": "true"
37+
},
3938
"cwd": "${workspaceFolder}/src/Bicep.Cli",
4039
"console": "internalConsole",
4140
"stopAtEntry": false
@@ -51,7 +50,7 @@
5150
"${file}"
5251
],
5352
"env": {
54-
"BICEP_TRACING_ENABLED": "true"
53+
"BICEP_TRACING_ENABLED": "true",
5554
},
5655
"cwd": "${workspaceFolder}/src/Bicep.Cli",
5756
"console": "internalConsole",

src/Bicep.Core/TypeSystem/Az/OciAzTypeLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static OciAzTypeLoader FromTgz(string pathToGzip)
5353

5454
protected override Stream GetContentStreamAtPath(string path)
5555
{
56-
if (this.typesCache.TryGetValue($"./{path}", out var bytes))
56+
if (this.typesCache.TryGetValue($"{path}", out var bytes))
5757
{
5858
return new MemoryStream(bytes);
5959
}

0 commit comments

Comments
 (0)