private static int RunCreate(CreateOptions options) { var projectPath = string.Empty; if (string.IsNullOrEmpty(options.Project)) { projectPath = Directory.GetCurrentDirectory(); options.Project = Path.GetFileNameWithoutExtension(projectPath); } else { projectPath = Path.Combine(Directory.GetCurrentDirectory(), options.Project); } if (!Directory.Exists(projectPath)) { Directory.CreateDirectory(projectPath); } throw new NotImplementedException(); var project = CPlusPlusProject.Create(null, projectPath, options.Project); if (project != null) { Console.WriteLine("Project created successfully."); return(1); } Console.WriteLine("Unable to create project. May already exist."); return(-1); }
public virtual async Task <IProject> Generate(ISolution solution, string name) { var location = Path.Combine(solution.CurrentDirectory, name); if (!Directory.Exists(location)) { Directory.CreateDirectory(location); } IProject project = CPlusPlusProject.Create(solution, location, name); project = solution.AddProject(project); if (solution.StartupProject == null) { solution.StartupProject = project; } return(project); }