diff --git a/internal/creator/creator.go b/internal/creator/creator.go index 638b720..f1b3f37 100644 --- a/internal/creator/creator.go +++ b/internal/creator/creator.go @@ -183,7 +183,7 @@ func (creator Creator) createConfig(project common.Project, cfg config.Config) e func (creator Creator) createTasks(project common.Project, cfg config.Config) error { - tasks := newVisualStudioCodeTaskList(cfg) + tasks := newVisualStudioCodeTaskList(cfg, creator.CreateGitRepo) tasksPath := project.RelPath(visualStudioDirName, visualStudioCodeTasksFileName) return creator.WriteJSONFileIfNotExists(tasksPath, tasks) diff --git a/internal/creator/vscode_task.go b/internal/creator/vscode_task.go index f86c52c..b04b60e 100644 --- a/internal/creator/vscode_task.go +++ b/internal/creator/vscode_task.go @@ -29,7 +29,7 @@ type visualStudioCodeTasks struct { Tasks []visualStudioCodeTask `json:"tasks"` } -func newVisualStudioCodeTaskList(cfg config.Config) *visualStudioCodeTasks { +func newVisualStudioCodeTaskList(cfg config.Config, createGitRepo bool) *visualStudioCodeTasks { result := &visualStudioCodeTasks{ Version: "2.0.0", Tasks: []visualStudioCodeTask{ @@ -45,5 +45,10 @@ func newVisualStudioCodeTaskList(cfg config.Config) *visualStudioCodeTasks { newVisualStudioCodeTask(cfg, "run (debug)", "DEBUG=1 go-james run"), }, } + if createGitRepo == true { + result.Tasks = append(result.Tasks, + newVisualStudioCodeTask(cfg, "push to github", "git push --set-upstream origin"), + ) + } return result }