예제 #1
0
        void TrySaveFile(string projectRootFolder, CsharpProjectFileToSave file)
        {
            var filename = Path.Combine(projectRootFolder, file.PathRelativeToProjectRoot);

            Directory.CreateDirectory(Path.GetDirectoryName(filename));

            var overrideFilename = Path.GetDirectoryName(filename) + "\\" + Path.GetFileNameWithoutExtension(filename) + "Override" + Path.GetExtension(filename);

            if (File.Exists(overrideFilename))
            {
                if (File.Exists(filename))
                {
                    File.Delete(filename);
                }

                File.WriteAllText(
                    filename + ".txt",
                    file.Content);
            }
            else
            {
                File.WriteAllText(
                    filename,
                    file.Content);
            }
        }
예제 #2
0
 void SaveFile(string projectRootFolder, CsharpProjectFileToSave file)
 {
     try
     {
         TrySaveFile(projectRootFolder, file);
     }
     catch (Exception exception)
     {
         logger.LogFileSaveError(projectRootFolder, exception);
     }
 }