private async Task PromoteNewerPackage(string unpackdPath) { var success = await _file.Move(unpackdPath, TargetPath); if (!success) { throw Fault.CantMove(unpackdPath, TargetPath); } }
private async Task <bool> RetireCurrentPackage(bool useSystemRetirementDir) { var retirement = useSystemRetirementDir ? _file.GetTempFilePath() : TargetPath + ".retired"; var success = await _file.Move(TargetPath, retirement); if (!success) { throw Fault.CantMove(TargetPath, retirement); } if (_file.Found(TargetPath)) { SetStatus($"Failed to retire current package to “{Path.GetPathRoot(retirement)}”."); return(false); } return(true); }