handle versionless package names in installer
This commit is contained in:
parent
e527f6e3d1
commit
7b32a16fd8
|
@ -103,11 +103,19 @@ namespace Oqtane.Infrastructure
|
||||||
List<string> assets = new List<string>();
|
List<string> assets = new List<string>();
|
||||||
bool manifest = false;
|
bool manifest = false;
|
||||||
|
|
||||||
// packages are in form of name.1.0.0.nupkg or name.culture.1.0.0.nupkg
|
// remove version information from package name
|
||||||
string name = Path.GetFileNameWithoutExtension(packagename);
|
string name = Path.GetFileNameWithoutExtension(packagename);
|
||||||
string[] segments = name?.Split('.');
|
string[] segments = name.Split('.');
|
||||||
// remove version information from name
|
// packages are in form of name.1.0.0.nupkg or name.culture.1.0.0.nupkg or name.nupkg (versionless)
|
||||||
if (segments != null) name = string.Join('.', segments, 0, segments.Length - 3);
|
try
|
||||||
|
{
|
||||||
|
if (segments.Length > 3)
|
||||||
|
{
|
||||||
|
Version version = Version.Parse(string.Join('.', segments, segments.Length - 3, 3));
|
||||||
|
name = string.Join('.', segments, 0, segments.Length - 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { } // no version in packagename
|
||||||
|
|
||||||
// deploy to appropriate locations
|
// deploy to appropriate locations
|
||||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user