mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Extract method
This commit is contained in:
@@ -36,15 +36,10 @@ namespace Squirrel
|
||||
|
||||
bool shouldInitialize = false;
|
||||
try {
|
||||
var file = File.OpenRead(localReleaseFile);
|
||||
|
||||
// NB: sr disposes file
|
||||
using (var sr = new StreamReader(file, Encoding.UTF8)) {
|
||||
localReleases = ReleaseEntry.ParseReleaseFile(sr.ReadToEnd());
|
||||
}
|
||||
localReleases = LoadLocalReleases(localReleaseFile);
|
||||
} catch (Exception ex) {
|
||||
// Something has gone wrong, we'll start from scratch.
|
||||
this.Log().WarnException("Failed to load local release list", ex);
|
||||
// Something has gone pear-shaped, let's start from scratch
|
||||
this.Log().WarnException("Failed to load local releases, starting from scratch", ex);
|
||||
shouldInitialize = true;
|
||||
}
|
||||
|
||||
@@ -111,6 +106,17 @@ namespace Squirrel
|
||||
return ret;
|
||||
}
|
||||
|
||||
public IEnumerable<ReleaseEntry> LoadLocalReleases(string localReleaseFile)
|
||||
{
|
||||
var file = File.OpenRead(localReleaseFile);
|
||||
|
||||
// NB: sr disposes file
|
||||
using (var sr = new StreamReader(file, Encoding.UTF8)) {
|
||||
return ReleaseEntry.ParseReleaseFile(sr.ReadToEnd());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async Task initializeClientAppDirectory()
|
||||
{
|
||||
// On bootstrap, we won't have any of our directories, create them
|
||||
|
||||
Reference in New Issue
Block a user