Skip to content

Commit

Permalink
removed the attachment property
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMelcher committed May 2, 2022
1 parent b7e3777 commit 42f8209
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ output/*
/AzureDevOps.WikiPDFExport/Properties/launchSettings.json
AzureDevOps.WikiPDFExport.Test/IntegrationTests-Data/Outputs
AzureDevOps.WikiPDFExport.Test/test-data/Inputs/Azure-Platform-Design/*
AzureDevOps.WikiPDFExport.Test/test-data/Inputs/1k/html.html
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"args": [
"--verbose",
//"-p..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\DeepLink",
//"-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\AzureDevOps.WikiPDFExport.wiki",
"-p..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\1k",
// "--attachments-path=..\\AzureDevOps.WikiPDFExport.Test\\Tests\\AzureDevOps.WikiPDFExport.wiki\\.attachments\\",
"-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\Code",
// "-p..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\Code",
// "-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\Azure-Platform-Design",
//"-p..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\Test-Emoticon",
// "-s..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\Test-Emoticon\\emoji.md",
Expand Down
1 change: 0 additions & 1 deletion AzureDevOps.WikiPDFExport.Test/ExportedWikiDocTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public void givenExportDoc_whenGetProperties_thenNoneAreBlank()
var export = new ExportedWikiDoc(codeWiki);
AssertExistingValidDirectory(export.exportDir);
AssertExistingValidDirectory(export.baseDir);
AssertExistingValidDirectory(export.attachments);
}

private static void AssertExistingValidDirectory(DirectoryInfo dir)
Expand Down
8 changes: 4 additions & 4 deletions AzureDevOps.WikiPDFExport/ExportedWikiDoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ public ExportedWikiDoc(DirectoryInfo exportBase)
{
if (!exportBase.Exists)
{
throw new WikiPdfExportException("The wiki export location does not exist");
throw new WikiPdfExportException($"The wiki export location {exportBase} does not exist");
}
this.exportDir = exportBase;
this.baseDir = FindNearestParentAttachmentsDirectory(exportBase);
this.attachments = baseDir.GetDirectories("./.attachments")[0];
}

/// <summary>
Expand All @@ -53,7 +52,9 @@ public static DirectoryInfo FindNearestParentAttachmentsDirectory(DirectoryInfo
{
return FindNearestParentAttachmentsDirectory(exportBase.Parent);
}
throw new WikiPdfExportException("Failed to locate the base of the Wiki using attachment detection");

//return the base path and hope for the best
return exportBase;
}

public DirectoryInfo exportDir { get; }
Expand All @@ -66,6 +67,5 @@ public string basePath()
{
return baseDir.FullName;
}
public DirectoryInfo attachments { get; }
}
}

0 comments on commit 42f8209

Please sign in to comment.