/// <summary> /// Creates a new project from this template at the project directory with a given set of <paramref name="projectOptions"/>. /// </summary> /// <param name="projectOptions">The console arguments that controls the creation process of the to-be-created project.</param> protected void CreateNewProject(ProjectOptions projectOptions) { if (_created) { return; } _created = true; string shortName = GetTemplateShortNameAtTemplateFolder(); Logger.WriteLine($"Creates new project from template {shortName} at {ProjectDirectory.FullName}"); RunDotNet($"new -i {_templateDirectory.FullName}"); string commandArguments = projectOptions.ToCommandLineArguments(); RunDotNet($"new {shortName} {commandArguments ?? String.Empty} -n {ProjectName} -o {ProjectDirectory.FullName}"); projectOptions.UpdateProjectToCorrectlyUseOptions(FixtureDirectory, ProjectDirectory); }
/// <summary> /// Initializes a new instance of the <see cref="ProjectOptions"/> class. /// </summary> public ProjectOptions(ProjectOptions options) : this(options?._arguments, options?._updateProject) { }