mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fix update resolution in osx test
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -59,7 +59,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Rename OSX Binary
|
- name: Rename OSX Binary
|
||||||
working-directory: src/Rust/target/release
|
working-directory: src/Rust/target/release
|
||||||
run: mv update updatemac
|
run: cp update updatemac
|
||||||
if: ${{ matrix.os == 'macos-latest' }}
|
if: ${{ matrix.os == 'macos-latest' }}
|
||||||
|
|
||||||
- name: Build .NET
|
- name: Build .NET
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using Velopack;
|
||||||
|
|
||||||
public static class PathHelper
|
public static class PathHelper
|
||||||
{
|
{
|
||||||
@@ -28,6 +29,18 @@ public static class PathHelper
|
|||||||
public static string GetRustAsset(params string[] names)
|
public static string GetRustAsset(params string[] names)
|
||||||
=> Path.Combine(new string[] { GetRustBuildOutputDir() }.Concat(names).ToArray());
|
=> Path.Combine(new string[] { GetRustBuildOutputDir() }.Concat(names).ToArray());
|
||||||
|
|
||||||
|
public static string CopyUpdateTo(string dir)
|
||||||
|
{
|
||||||
|
var updateName = "update.exe";
|
||||||
|
if (VelopackRuntimeInfo.IsOSX) {
|
||||||
|
updateName = "update";
|
||||||
|
}
|
||||||
|
var path = GetRustAsset(updateName);
|
||||||
|
var newPath = Path.Combine(dir, updateName);
|
||||||
|
File.Copy(path, newPath);
|
||||||
|
return newPath;
|
||||||
|
}
|
||||||
|
|
||||||
public static string GetTestRoot()
|
public static string GetTestRoot()
|
||||||
{
|
{
|
||||||
// XXX: This is an evil hack, but it's okay for a unit test
|
// XXX: This is an evil hack, but it's okay for a unit test
|
||||||
|
|||||||
@@ -190,12 +190,9 @@ namespace Velopack.Tests
|
|||||||
var basePkgPath = Path.Combine(packagesDir, basePkg.OriginalFilename);
|
var basePkgPath = Path.Combine(packagesDir, basePkg.OriginalFilename);
|
||||||
File.Copy(basePkgFixturePath, basePkgPath);
|
File.Copy(basePkgFixturePath, basePkgPath);
|
||||||
|
|
||||||
var updateExe = PathHelper.GetRustAsset("update.exe");
|
var updateExe = PathHelper.CopyUpdateTo(packagesDir);
|
||||||
var copiedExe = Path.Combine(packagesDir, "update.exe");
|
|
||||||
File.Copy(updateExe, copiedExe);
|
|
||||||
|
|
||||||
var locator = new TestVelopackLocator(id, fromVersion,
|
var locator = new TestVelopackLocator(id, fromVersion,
|
||||||
packagesDir, null, null, copiedExe, logger);
|
packagesDir, null, null, updateExe, logger);
|
||||||
var um = new UpdateManager(source, logger, locator);
|
var um = new UpdateManager(source, logger, locator);
|
||||||
|
|
||||||
var info = await um.CheckForUpdatesAsync();
|
var info = await um.CheckForUpdatesAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user