Exemple #1
0
        private void CopyShim(string shimPath, string outputFolder)
        {
            string destination = Path.Combine(outputFolder, Path.GetFileName(shimPath));

            if (!fileUtil.Exists(destination))
            {
                fileUtil.Copy(shimPath, destination);
            }
        }
Exemple #2
0
        private string PrepareOutputDir(Project project, TemplateMeta templateMeta)
        {
            // here we need to copy the template folder to the output directory
            // and customize the template
            var templateName       = templateMeta.TemplateData.Name;
            var sourceTemplatePath = Path.Combine(project.TemplateDirectory, templateName, templateMeta.TemplateLocation.Trim(Path.DirectorySeparatorChar));
            var destTemplatePath   = Path.Combine(project.OutputDirectory, $"{project.Name}-{templateName}");

            if (_fileUtil.DirectoryExists(destTemplatePath))
            {
                _fileUtil.DirectoryDelete(destTemplatePath, true);
            }

            _fileUtil.Copy(sourceTemplatePath, destTemplatePath);

            _templateService.CustomizeTemplate(project, destTemplatePath, templateMeta.TemplateData.Name);

            return(destTemplatePath);
        }