Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples folder gets lost when creating new packages. #80

Closed
mmsmits opened this issue Oct 19, 2023 · 0 comments · Fixed by #91
Closed

Examples folder gets lost when creating new packages. #80

mmsmits opened this issue Oct 19, 2023 · 0 comments · Fixed by #91
Assignees
Labels
bug Something isn't working

Comments

@mmsmits
Copy link
Member

mmsmits commented Oct 19, 2023

The culprit seems to be CreatePackage(IEnumerable<FileEntries> enrtries, bool moveToPackageFolder = true) where the default boolean parameter, makes sure all entries goes directly in the package folder, and removes the example folder.

See also this unit test:

[TestMethod]
public void KeepExistingFolderStructureIfAlreadyInPackagesFolder()
{
    var entries = new List<FileEntry>
    {
        createFileEntry("{\"resourceType\": \"Patient\",\"id\": \"example\",\"gender\": \"male\",\"birthDate\": \"1974-12-25\"}", @"package\patient-profile.json"),
        createFileEntry("{\"resourceType\": \"Patient\",\"id\": \"example2\",\"gender\": \"female\",\"birthDate\": \"1974-12-25\"}", @"package\examples\example-patient.json"),
    };

    var files = entries.ChangeFolder(PackageFileNames.PACKAGEFOLDER);

    files.Should().Contain(e => e.FilePath == @"package\patient-profile.json");
    files.Should().Contain(e => e.FilePath == @"package\examples\example-patient.json");
}

One idea would be to keep the folder structure as it is if its already in the right structure.

@mmsmits mmsmits added bug Something isn't working firely favorite labels Oct 19, 2023
@mmsmits mmsmits changed the title Examples folder gets los when creating new packages. Examples folder gets lost when creating new packages. Oct 19, 2023
@mmsmits mmsmits self-assigned this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant