コード例 #1
0
        public void Unpack(string packedPackagePath, bool overwrite, string destinationPath = null)
        {
            CheckUnpackArgument(packedPackagePath);
            CheckPackedPackageExistsAndNotEmpty(packedPackagePath);
            destinationPath = _fileSystem.GetCurrentDirectoryIfEmpty(destinationPath);
            string destinationPackageDirectory =
                _fileSystem.GetDestinationFileDirectory(packedPackagePath, destinationPath);

            _fileSystem.CheckOrOverwriteExistsDirectory(destinationPackageDirectory, overwrite);
            _compressionUtilities.UnpackFromGZip(packedPackagePath, destinationPackageDirectory);
        }
コード例 #2
0
 public void CopyPackageElements(string sourcePath, string destinationPath, bool overwrite)
 {
     sourcePath.CheckArgumentNullOrWhiteSpace(nameof(sourcePath));
     destinationPath.CheckArgumentNullOrWhiteSpace(nameof(destinationPath));
     _fileSystem.CheckOrOverwriteExistsDirectory(destinationPath, overwrite);
     foreach (string packageElementName in PackageElementNames)
     {
         CopyPackageElement(sourcePath, destinationPath, packageElementName);
     }
     File.Copy(Path.Combine(sourcePath, "descriptor.json"),
               Path.Combine(destinationPath, "descriptor.json"));
 }