mirror of https://github.com/Jackett/Jackett
Delete old files during update
This commit is contained in:
parent
8a149ebe47
commit
85bb2dba34
|
@ -155,7 +155,7 @@ namespace Jackett.Updater
|
|||
}
|
||||
}
|
||||
|
||||
// delete old files
|
||||
// delete old dirs
|
||||
string[] oldDirs = new string[] { "Content/logos" };
|
||||
|
||||
foreach (var oldDir in oldDirs)
|
||||
|
@ -175,6 +175,32 @@ namespace Jackett.Updater
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// delete old files
|
||||
string[] oldFiles = new string[] {
|
||||
"Content/css/jquery.dataTables.css",
|
||||
"Content/css/jquery.dataTables_themeroller.css",
|
||||
"Definitions/tspate.yml",
|
||||
"Definitions/freakstrackingsystem.yml",
|
||||
};
|
||||
|
||||
foreach (var oldFIle in oldFiles)
|
||||
{
|
||||
try
|
||||
{
|
||||
var deleteFile = Path.Combine(options.Path, oldFIle);
|
||||
if (File.Exists(deleteFile))
|
||||
{
|
||||
Engine.Logger.Info("Deleting file " + deleteFile);
|
||||
File.Delete(deleteFile);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Engine.Logger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
// kill pids after the update on UNIX
|
||||
if (!isWindows)
|
||||
KillPids(pids);
|
||||
|
|
Loading…
Reference in New Issue