mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix for the temp folder being on a different drive.
This commit is contained in:
parent
615f059bd5
commit
07bc3546bb
@ -136,7 +136,7 @@ namespace Wabbajack.BuildServer.Controllers
|
||||
var originalName = $"{parts[0]}{parts[2]}";
|
||||
|
||||
var finalPath = "public".RelativeTo(AbsolutePath.EntryPoint).Combine("files", finalName);
|
||||
_settings.TempPath.Combine(Key).MoveTo(finalPath);
|
||||
await _settings.TempPath.Combine(Key).MoveToAsync(finalPath);
|
||||
|
||||
var hash = await finalPath.FileHashAsync();
|
||||
|
||||
|
@ -156,15 +156,44 @@ namespace Wabbajack.Common
|
||||
throw new ArgumentException("Could not find entry point.");
|
||||
return ((AbsolutePath)location).Parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AbsolutePath Root => (AbsolutePath)Path.GetPathRoot(_path);
|
||||
|
||||
/// <summary>
|
||||
/// Moves this file to the specified location
|
||||
/// Moves this file to the specified location, will use Copy if required
|
||||
/// </summary>
|
||||
/// <param name="otherPath"></param>
|
||||
/// <param name="overwrite">Replace the destination file if it exists</param>
|
||||
public void MoveTo(AbsolutePath otherPath, bool overwrite = false)
|
||||
{
|
||||
if (Root != otherPath.Root)
|
||||
{
|
||||
if (otherPath.Exists && overwrite)
|
||||
otherPath.Delete();
|
||||
|
||||
CopyTo(otherPath);
|
||||
return;
|
||||
}
|
||||
File.Move(_path, otherPath._path, overwrite ? MoveOptions.ReplaceExisting : MoveOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves this file to the specified location, will use Copy if required
|
||||
/// </summary>
|
||||
/// <param name="otherPath"></param>
|
||||
/// <param name="overwrite">Replace the destination file if it exists</param>
|
||||
public async Task MoveToAsync(AbsolutePath otherPath, bool overwrite = false)
|
||||
{
|
||||
if (Root != otherPath.Root)
|
||||
{
|
||||
if (otherPath.Exists && overwrite)
|
||||
otherPath.Delete();
|
||||
|
||||
await CopyToAsync(otherPath);
|
||||
Delete();
|
||||
return;
|
||||
}
|
||||
File.Move(_path, otherPath._path, overwrite ? MoveOptions.ReplaceExisting : MoveOptions.None);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user