示例#1
0
        private ISet <TargetRelativePath> DeployDirectoryContents(IFileSystemDirectory depDir, string directoryPath, string subDir)
        {
            var result = new HashSet <TargetRelativePath>();

            //Files
            foreach (var file in repository.ListFiles(directoryPath))
            {
                var fileName = Path.GetFileName(file);
                repository.Copy(file, depDir, Path.Combine(subDir, fileName));
                result.Add(new TargetRelativePath(targetRoot.GetRelativePath(depDir), Path.Combine(subDir, fileName)));
            }

            //Child directories
            var directory = new LocalFileSystemDirectory(directoryPath);

            foreach (var childDirectory in directory.ChildDirectories)
            {
                var dir         = directory.GetChildDirectory(childDirectory);
                var dirContents = DeployDirectoryContents(depDir, dir.ToString(), Path.Combine(subDir, childDirectory));
                foreach (var path in dirContents)
                {
                    result.Add(path);
                }
            }

            return(result);
        }
        private ISet <TargetRelativePath> DeployDirectoryContents(IFileSystemDirectory depDir)
        {
            var result = new HashSet <TargetRelativePath>();

            foreach (var file in repository.ListFiles(Path.GetDirectoryName(resolvedPath)))
            {
                var fileName = Path.GetFileName(file);
                repository.Copy(file, depDir, fileName);
                result.Add(new TargetRelativePath(targetRoot.GetRelativePath(depDir), fileName));
            }

            return(result);
        }