Skip to content

Commit b0f9fba

Browse files
committed
fix scoop packages installed from url breaking on UniGetUI (fix #2853)
1 parent 5e9e200 commit b0f9fba

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/UniGetUI.PackageEngine.Managers.Scoop/Providers/ScoopOperationProvider.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ public override IEnumerable<string> GetOperationParameters(IPackage package, IIn
1616
OperationType.Uninstall => Manager.Properties.UninstallVerb,
1717
_ => throw new InvalidDataException("Invalid package operation")
1818
}];
19-
parameters.Add($"{package.Source.Name}/{package.Id}");
19+
20+
if(package.Source.Name.Contains("..."))
21+
parameters.Add($"{package.Id}");
22+
else
23+
parameters.Add($"{package.Source.Name}/{package.Id}");
2024

2125
if (package.OverridenOptions.Scope == PackageScope.Global ||
2226
(package.OverridenOptions.Scope is null && options.InstallationScope == PackageScope.Global))
@@ -26,7 +30,7 @@ public override IEnumerable<string> GetOperationParameters(IPackage package, IIn
2630
parameters.Add("--global");
2731
}
2832

29-
if(options.CustomParameters is not null)
33+
if(options.CustomParameters?.Any() is true)
3034
parameters.AddRange(options.CustomParameters);
3135

3236
if (operation is OperationType.Uninstall)

src/UniGetUI.PackageEngine.Managers.Scoop/Providers/ScoopPackageDetailsProvider.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ protected override void GetDetails_UnSafe(IPackageDetails details)
3131
}
3232
}
3333

34+
string packageId;
35+
if(details.Package.Source.Name.Contains("..."))
36+
packageId = $"{details.Package.Id}";
37+
else
38+
packageId = $"{details.Package.Source.Name}/{details.Package.Id}";
39+
3440
Process p = new()
3541
{
3642
StartInfo = new ProcessStartInfo
3743
{
3844
FileName = Manager.Status.ExecutablePath,
39-
Arguments = Manager.Properties.ExecutableCallArgs + " cat " + details.Package.Source.Name + "/" + details.Package.Id,
45+
Arguments = Manager.Properties.ExecutableCallArgs + " cat " + packageId,
4046
RedirectStandardOutput = true,
4147
RedirectStandardError = true,
4248
UseShellExecute = false,

0 commit comments

Comments
 (0)