Skip to content
Snippets Groups Projects
Verified Commit 364609a7 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent 3acc08e6
No related branches found
No related tags found
No related merge requests found
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run add requirements" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="requirements add -p $PROJECT_DIR$/development/examples/example1 --id=1425" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$/application/source" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="go build requirements-manager and run print changelog" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="requirements-manager" />
<working_directory value="$PROJECT_DIR$/application/source" />
<parameters value="privacy print --date-format 01.02.2006 -p $PROJECT_DIR$/development/examples/example1" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$/application/source" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
......@@ -48,7 +48,7 @@ const defaultOverviewTemplate = `
//
const defaultNewRequirementTemplate = `
---
ID: {{ .ID }}
ID: %%ID%%
Title: null
# Reference to other requirements
......@@ -165,7 +165,7 @@ Privacy:
...
### {{ .ID }} {{ .Title }}
### {{ .Title }} - {{ .ID }}
#### Subheading
......@@ -173,8 +173,8 @@ Privacy:
- [ ] task 2
{{ if .hasItems }}
**Items**
{{ if .Items }}
#### Items
| ID | Name | Delivery until | Provided on |
|--------------------|--------------|----------------------:|-----------------------------------------:|
......
......@@ -3,10 +3,10 @@ package main
import (
"bytes"
"fmt"
"html/template"
"os"
"path"
"reflect"
"strings"
"time"
"github.com/olekukonko/tablewriter"
......@@ -50,25 +50,34 @@ func addRequirement(config *Configuration, arguments *commandLineOptions) error
printErrorAndExit(2, "the request with id already exists", arguments.Requirements.Add.ID, p)
}
t, err := template.New("requirement").Parse(config.Requirement.Template.Add)
if err != nil {
return err
}
d := requirement{}
d.ID = arguments.Requirements.Add.ID
t := config.Requirement.Template.Add
t = strings.Replace(t, "%%ID%%", arguments.Requirements.Add.ID, -1)
f, err := os.Create(p)
d1 := []byte(t)
err := os.WriteFile(p, d1, 0644)
if err != nil {
return err
}
defer f.Close()
err = t.Execute(f, d)
if err != nil {
return err
}
//t, err := template.New("requirement").Parse(config.Requirement.Template.Add)
//if err != nil {
// return err
//}
//
//d := requirement{}
//d.ID = arguments.Requirements.Add.ID
//
//f, err := os.Create(p)
//if err != nil {
// return err
//}
//
//defer f.Close()
//
//err = t.Execute(f, d)
//if err != nil {
// return err
//}
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment