Commit 67012275 authored by tsuji's avatar tsuji

同じディレクトリで2回目を実行するとImageフォルダが初期化される不具合を修正

parent a52ec000
...@@ -148,7 +148,7 @@ namespace GetADoc ...@@ -148,7 +148,7 @@ namespace GetADoc
MessageBoxButton.YesNo, MessageBoxImage.None); MessageBoxButton.YesNo, MessageBoxImage.None);
if (OverwriteADoc == MessageBoxResult.Yes) if (OverwriteADoc == MessageBoxResult.Yes)
{ {
RunBatch.deleteFolder(filePath, fileName, IconFlag, SepaFlag);
} }
else if (OverwriteADoc == MessageBoxResult.No) else if (OverwriteADoc == MessageBoxResult.No)
{ {
......
...@@ -22,38 +22,10 @@ namespace GetADoc ...@@ -22,38 +22,10 @@ namespace GetADoc
return inFileName; return inFileName;
} }
//先に同名フォルダが存在すれば削除(エラー回避のため)
public static void deleteFolder(string filePath, string fileName, bool icon, bool sepa)
{
File.Delete(filePath + fileName + ".adoc");
File.Delete(System.IO.Path.Combine(filePath, "config.adoc"));
if(sepa == true)
{
File.Delete(System.IO.Path.Combine(filePath, "IncDoc.adoc"));
}
if (Directory.Exists(System.IO.Path.Combine(filePath, "Images")))
{
Directory.Delete(System.IO.Path.Combine(filePath, "Images"), true);
}
if (Directory.Exists(System.IO.Path.Combine(filePath, "icons")) && icon == true)
{
Directory.Delete(System.IO.Path.Combine(filePath, "icons"), true);
}
if (Directory.Exists(System.IO.Path.Combine(filePath, "Sub_First")) && sepa == true)
{
Directory.Delete(System.IO.Path.Combine(filePath, "Sub_First"), true);
}
if (Directory.Exists(System.IO.Path.Combine(filePath, "Sub_Second")) && sepa == true)
{
Directory.Delete(System.IO.Path.Combine(filePath, "Sub_Second"), true);
}
}
//バッチファイルの実行 //バッチファイルの実行
public static void runBatch(bool icon, bool screen, bool sepa, string fileName, string filePath) public static void runBatch(bool icon, bool screen, bool sepa, string fileName, string filePath)
{ {
//テンポラリフォルダの作成
var tempPath = TemporaryFolder.MakeTempFolder();
//コンソール呼び出し //コンソール呼び出し
ProcessStartInfo processStartInfo = new ProcessStartInfo(); ProcessStartInfo processStartInfo = new ProcessStartInfo();
...@@ -77,7 +49,11 @@ namespace GetADoc ...@@ -77,7 +49,11 @@ namespace GetADoc
{ {
processStartInfo.Arguments += "/SepaDoc "; processStartInfo.Arguments += "/SepaDoc ";
} }
var pathAndName = System.IO.Path.Combine(tempPath, fileName);
//既存の生成物が指定先フォルダに存在する場合は上書きする
processStartInfo.Arguments += "/Force ";
var pathAndName = System.IO.Path.Combine(filePath, fileName);
processStartInfo.Arguments += pathAndName; processStartInfo.Arguments += pathAndName;
//GetADoc.batを実行 //GetADoc.batを実行
...@@ -85,11 +61,7 @@ namespace GetADoc ...@@ -85,11 +61,7 @@ namespace GetADoc
process.WaitForExit(); process.WaitForExit();
process.Close(); process.Close();
//指定されたフォルダに生成物を移動
RunBatch.MoveDirectory(tempPath, filePath);
//テンポラリフォルダの消去
TemporaryFolder.DeleteTempFolder(tempPath);
} }
/// <summary> /// <summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment