Skip to content

Commit e8bda53

Browse files
author
Bruce Haley
committed
Handle "template:" references lacking "- " prefix
1 parent a56a57c commit e8bda53

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

ExportPipelineDefinitions/ExportPipelineDefinitions.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@
4848
<WarningLevel>4</WarningLevel>
4949
</PropertyGroup>
5050
<ItemGroup>
51-
<Reference Include="Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c6752e45808247c2, processorArchitecture=MSIL">
52-
<HintPath>..\packages\JSON.1.0.1\lib\net40\Json.dll</HintPath>
53-
</Reference>
54-
<Reference Include="Newtonsoft.Json, Version=(13.0.1,), Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
55-
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
56-
</Reference>
5751
<Reference Include="System" />
5852
<Reference Include="System.Core" />
5953
<Reference Include="System.Xml.Linq" />
@@ -74,7 +68,6 @@
7468
</ItemGroup>
7569
<ItemGroup>
7670
<None Include="App.config" />
77-
<None Include="packages.config" />
7871
<None Include="Properties\Settings.settings">
7972
<Generator>SettingsSingleFileGenerator</Generator>
8073
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -93,5 +86,13 @@
9386
<Install>false</Install>
9487
</BootstrapperPackage>
9588
</ItemGroup>
89+
<ItemGroup>
90+
<PackageReference Include="JSON">
91+
<Version>1.0.1</Version>
92+
</PackageReference>
93+
<PackageReference Include="Newtonsoft.Json">
94+
<Version>13.0.1</Version>
95+
</PackageReference>
96+
</ItemGroup>
9697
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9798
</Project>

ExportPipelineDefinitions/Program.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,17 +523,18 @@ private static bool DownloadFileFromGithub(string githubFileUrl, string outputFi
523523
private static void AddYamlTemplateReferencesFromFile(
524524
string targetFullFilePath, string currentOffsetFromRootUrl, ref List<string> yamlFileNames)
525525
{
526-
//List<string> references = new List<string>();
527-
string match = "- template:";
526+
string match = "template:";
528527

529528
var lines = File.ReadLines(targetFullFilePath);
530529
foreach (string line in lines)
531530
{
532531
if (line.Contains(match))
533532
{
534-
string name = line.Replace(match, "").Trim();
535-
int index = name.IndexOf("#");
536-
if (index >= 0) name = name.Remove(index).TrimEnd(); // Remove any comment
533+
string name = line.Trim();
534+
if (name.StartsWith("::")) name = ""; // Delete an inline script comment.
535+
int index = name.IndexOf("#"); // Find and remove any other comment.
536+
if (index >= 0) name = name.Remove(index).TrimEnd();
537+
name = name.TrimStart('-').Replace(match, "").Trim(); // TrimStart() handles the case of "- template:".
537538
if (!String.IsNullOrWhiteSpace(name))
538539
{
539540
// Normalize the relative path.

ExportPipelineDefinitions/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.2.0.0")]
36-
[assembly: AssemblyFileVersion("1.2.0.0")]
35+
[assembly: AssemblyVersion("1.3.1.0")]
36+
[assembly: AssemblyFileVersion("1.3.1.0")]

ExportPipelineDefinitions/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)