本文整理汇总了C#中NuGet.ZipPackage.GetFullName方法的典型用法代码示例。如果您正苦于以下问题:C# ZipPackage.GetFullName方法的具体用法?C# ZipPackage.GetFullName怎么用?C# ZipPackage.GetFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NuGet.ZipPackage
的用法示例。
在下文中一共展示了ZipPackage.GetFullName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindPackage
private IPackage FindPackage(out string path)
{
path = null;
var dir = CommonHelper.MapPath(UpdatePackagePath, false);
if (!Directory.Exists(dir))
return null;
var files = Directory.GetFiles(dir, "SmartStore.*.nupkg", SearchOption.TopDirectoryOnly);
// TODO: allow more than one package in folder and return newest
if (files == null || files.Length == 0 || files.Length > 1)
return null;
IPackage package = null;
try
{
path = files[0];
package = new ZipPackage(files[0]);
_logger = CreateLogger(package);
_logger.Information("Found update package '{0}'".FormatInvariant(package.GetFullName()));
return package;
}
catch { }
return null;
}
示例2: DoConfigure
private string DoConfigure(string packagePath, Environment env, string outputPath)
{
_logger.InfoFormat("Configuring package {0} for {1}", new FileInfo(packagePath).Name, env.Name.ToUpper());
var workingDir = _fileSystem.CreateTempWorkingDir();
_logger.DebugFormat("Create temp work dir {0}", workingDir);
// read nupkg metadata
var nupkg = new ZipPackage(packagePath);
_logger.DebugFormat("Unzipping {0} to {1}", nupkg.GetFullName(), workingDir);
using (var zip = new ZipFile(packagePath))
{
zip.ExtractAll(workingDir);
}
_templateEngine.TransformDirectory(workingDir, env);
var packageName = nupkg.Id + "_v" + nupkg.Version + "_" + env.Name.ToUpper(CultureInfo.InvariantCulture) + ".nupkg";
var packageOutputPath = Path.Combine(outputPath, packageName);
_fileSystem.DeleteFile(packageOutputPath);
using (var zip = new ZipFile(packageOutputPath))
{
zip.AddDirectory(workingDir);
zip.Save();
}
_fileSystem.DeleteDirectory(workingDir);
return packageOutputPath;
}