Skip to content

Commit

Permalink
fix relative path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyZhou committed Feb 18, 2021
1 parent ade602e commit 548b717
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ protected void BuildAndUseBicepTemplate()
{
if (BicepUtility.IsBicepFile(TemplateFile))
{
TemplateFile = BicepUtility.BuildFile(this.ExecuteScript<Object>, TemplateFile);
TemplateFile = BicepUtility.BuildFile(this.ExecuteScript<Object>, this.ResolvePath(TemplateFile));
}

if (BicepUtility.IsBicepFile(TemplateUri))
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Resources/ResourceManager/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,7 @@ You can help us improve the accuracy of the result by opening an issue here: htt
<data name="BicepNotFound" xml:space="preserve">
<value>Cannot find Bicep. Please add Bicep to your PATH or visit https://github.com/Azure/bicep/releases to install Bicep.</value>
</data>
<data name="InvalidBicepFilePathOrUri" xml:space="preserve">
<value>Invalid Bicep file path or uri.</value>
</data>
</root>
4 changes: 4 additions & 0 deletions src/Resources/ResourceManager/Utilities/BicepUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public static string BuildFile<T>(ScriptExecutor<T> executeScript, string bicepT
{
File.Copy(bicepTemplateFilePath, tempPath, true);
}
else
{
throw new AzPSArgumentException(Properties.Resources.InvalidBicepFilePathOrUri, bicepTemplateFilePath);
}
executeScript($"bicep build '{tempPath}'");
return tempPath.Replace(".bicep", ".json");
}
Expand Down

0 comments on commit 548b717

Please sign in to comment.