diff --git a/Makefile b/Makefile index ec3c005..2abedb6 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ test-template: cleanup-test-dir --ProjectName my-go-project \ --IncludeReadme no \ --ProjectDescription "bla bla" \ - --ExampleType simple + --ProjectType simple cd $(TMP_DIR) &&\ make diff --git a/inputs/cli_test.go b/inputs/cli_test.go index 6f1b87d..95b1537 100644 --- a/inputs/cli_test.go +++ b/inputs/cli_test.go @@ -66,9 +66,6 @@ func TestParseSelectCLIArgsInputs(t *testing.T) { require.NoError(t, err) assert.False(p.Answered) - err = ParseCLIArgsInputs(&mockInputsCollector{prompters: []Prompter{p}}, []string{"--s", "simple"}) - require.NoError(t, err) - err = ParseCLIArgsInputs(&mockInputsCollector{prompters: []Prompter{p}}, []string{"--s", "simple"}) require.NoError(t, err) assert.True(p.Answered) diff --git a/main.go b/main.go index f6d9bf4..cdab25b 100644 --- a/main.go +++ b/main.go @@ -8,17 +8,17 @@ import ( // See the README.md file for specification // END __INCLUDE_README__ -// BEGIN __SIMPLE__ +// BEGIN __ProjectType_SIMPLE__ // Simple section -// END __SIMPLE__ +// END __ProjectType_SIMPLE__ -// BEGIN __MEDIUM__ +// BEGIN __ProjectType_MEDIUM__ // Medium section -// END __MEDIUM__ +// END __ProjectType_MEDIUM__ -// BEGIN __ADVANCED__ +// BEGIN __ProjectType_ADVANCED__ // Advanced section -// END __ADVANCED__ +// END __ProjectType_ADVANCED__ func main() { cmd.Execute() diff --git a/transformations.yml b/transformations.yml index e85fb77..b131cb4 100644 --- a/transformations.yml +++ b/transformations.yml @@ -9,7 +9,7 @@ inputs: - id: ProjectDescription text: Please provide a long project description type: text - - id: ExampleType + - id: ProjectType text: Select example type type: select options: [ "simple", "medium", "advanced" ] @@ -45,18 +45,18 @@ transformations: files: ["*.go", "**/*.go"] - name: simple type: include - region_marker: __SIMPLE__ - condition: eq .ExampleType "simple" + region_marker: __ProjectType_SIMPLE__ # Instantiates Simple project + condition: eq .ProjectType "simple" files: ["main.go"] - - name: simple + - name: medium type: include - region_marker: __MEDIUM__ - condition: eq .ExampleType "medium" + region_marker: __ProjectType_MEDIUM__ # Instantiates Medium project + condition: eq .ProjectType "medium" files: ["main.go"] - name: advanced type: include - region_marker: __ADVANCED__ - condition: eq .ExampleType "advanced" + region_marker: __ProjectType_ADVANCED__ # Instantiates Advanced project + condition: eq .ProjectType "advanced" files: ["main.go"] after: operations: