Esempio n. 1
0
        private void SaveBidsAgnosticFiles(IRootFolder rootFolder, DatasetDescription datasetDescription, string changesFileContent, string readmeFileContent)
        {
            if (datasetDescription != null)
            {
                if (File.Exists(rootFolder.DatasetDescriptionFilePath))
                {
                    Warnings.Add($"{WarningFileSkipped}{rootFolder.DatasetDescriptionFilePath}");
                }
                else
                {
                    rootFolder.SaveDatasetDescriptionFile(datasetDescription);
                }
            }

            if (changesFileContent != null)
            {
                if (File.Exists(rootFolder.ChangesFilePath))
                {
                    Warnings.Add($"{WarningFileSkipped}{rootFolder.ChangesFilePath}");
                }
                else
                {
                    rootFolder.SaveChangesFile(changesFileContent);
                }
            }

            if (readmeFileContent != null)
            {
                if (File.Exists(rootFolder.ReadmeFilePath))
                {
                    Warnings.Add($"{WarningFileSkipped}{rootFolder.ReadmeFilePath}");
                }
                else
                {
                    rootFolder.SaveReadmeFile(readmeFileContent);
                }
            }
        }