Skip to content

Commit

Permalink
azp: always transform filepath using RelativeTo (#258)
Browse files Browse the repository at this point in the history
Absolute path can just use cwd / or .
  • Loading branch information
ChristopherHX authored Nov 2, 2023
1 parent 1426788 commit 258e07b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sdk/AzurePipelines/AzureDevops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public static async Task<MappingToken> ReadTemplate(Runner.Server.Azure.Devops.C
var fileId = templateContext.GetFileId(filename);
// Read the file
var finalRepository = afilenameAndRef.Length == 1 ? context.RepositoryAndRef : string.Equals(afilenameAndRef[1], "self", StringComparison.OrdinalIgnoreCase) ? null : (context.Repositories?.TryGetValue(afilenameAndRef[1], out var ralias) ?? false) ? ralias : throw new Exception($"Couldn't find repository with alias {afilenameAndRef[1]} in repository resources");
var finalFileName = context.RepositoryAndRef == finalRepository ? RelativeTo(context.CWD ?? ".", filename) : filename;
var finalFileName = RelativeTo(context.RepositoryAndRef == finalRepository ? context.CWD ?? "." : "/", filename);
if(finalFileName == null) {
throw new Exception($"Couldn't find template location {filenameAndRef}");
}
Expand Down

0 comments on commit 258e07b

Please sign in to comment.