Skip to content

Commit

Permalink
Platforms: no highest-version upgrade dir on POSIX
Browse files Browse the repository at this point in the history
As the Scalar.Service does not run the ProductUpgradeTimer on
macOS, and there is no Scalar.Service on Linux, and because
the UpgradeVerb does not record any highest-available version data
except on Windows, there is no necessity to implement the
GetUpgradeHighestAvailableVersionDirectory() method on POSIX.

We can therefore just return a NotImplementedException(),
and also simplify the GetUpgradeLogDirectoryParentDirectory()
method, which is used on POSIX to provide the path to the
log file generated by the "scalar upgrade" command.
  • Loading branch information
chrisd8088 committed Oct 10, 2020
1 parent 7e2094b commit 5abf595
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Scalar.Common/Platforms/POSIX/POSIXPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ public override string GetUpgradeProtectedDataDirectory()

public override string GetUpgradeLogDirectoryParentDirectory()
{
return this.GetUpgradeNonProtectedDirectory();
return Path.Combine(this.GetCommonAppDataRootForScalar(), ProductUpgraderInfo.UpgradeDirectoryName);
}

public override string GetUpgradeHighestAvailableVersionDirectory()
{
return this.GetUpgradeNonProtectedDirectory();
throw new NotImplementedException();
}

public override Dictionary<string, string> GetPhysicalDiskInfo(string path, bool sizeStatsOnly)
Expand Down Expand Up @@ -392,11 +392,6 @@ private static bool TryGetEnvironmentVariable(string name, out string val, out s
return true;
}

private string GetUpgradeNonProtectedDirectory()
{
return Path.Combine(this.GetCommonAppDataRootForScalar(), ProductUpgraderInfo.UpgradeDirectoryName);
}

private static class NativeMethods
{
public static string ResolveSymlink(string path, int maxPathLength)
Expand Down

0 comments on commit 5abf595

Please sign in to comment.