Exception handled when old .tmp files read-only
When fetching a repository with the same name as an old repo, the .tmp folder may have read-only files left in it which it cannot delete. This change provides a message to the user about it. It may be possible to further extend this to make such files writable, but leaving it up to the user may be the safest option.
This commit is contained in:
parent
5c0e9d7e67
commit
f5b3680c38
|
@ -139,8 +139,15 @@ namespace SparkleLib {
|
|||
|
||||
SparkleLogger.LogInfo ("Fetcher", TargetFolder + " | Fetching folder: " + RemoteUrl);
|
||||
|
||||
if (Directory.Exists (TargetFolder))
|
||||
Directory.Delete (TargetFolder, true);
|
||||
try {
|
||||
if (Directory.Exists (TargetFolder))
|
||||
Directory.Delete (TargetFolder, true);
|
||||
|
||||
} catch (IOException) {
|
||||
this.errors.Add ("\"" + TargetFolder + "\" is read-only.");
|
||||
Failed ();
|
||||
return;
|
||||
}
|
||||
|
||||
this.thread = new Thread (() => {
|
||||
if (Fetch ()) {
|
||||
|
|
Loading…
Reference in a new issue