makefile with deploy, actions and projects to lowercase

This commit is contained in:
Erik Winter 2021-01-31 13:31:35 +01:00
parent f66b42566a
commit ea26758020
3 changed files with 14 additions and 6 deletions

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
test:
go test ./...
deploy:
go build -o gte-process-inbox ./cmd/process-inbox/main.go
go build -o gte-generate-recurring ./cmd/generate-recurring/main.go
scp gte-* zerocontent.org:bin/

View File

@ -293,7 +293,7 @@ func FieldFromBody(field, body string) (string, bool) {
fieldName := strings.ToLower(strings.TrimSpace(parts[0]))
if fieldName == field {
if value == "" {
value = strings.TrimSpace(parts[1])
value = lowerAndTrim(parts[1])
} else {
dirty = true
}
@ -309,17 +309,17 @@ func FieldFromSubject(field, subject string) string {
terms := strings.Split(subject, SUBJECT_SEPARATOR)
switch field {
case FIELD_ACTION:
return terms[len(terms)-1]
return lowerAndTrim(terms[len(terms)-1])
case FIELD_PROJECT:
if len(terms) < 2 {
return ""
}
return terms[len(terms)-2]
return lowerAndTrim(terms[len(terms)-2])
case FIELD_DUE:
if len(terms) < 3 {
return ""
}
return terms[len(terms)-3]
return lowerAndTrim(terms[len(terms)-3])
}
return ""

View File

@ -176,10 +176,11 @@ func (es *Imap) Messages(folder string) ([]*Message, error) {
}
func (es *Imap) Add(folder, subject, body string) error {
msgStr := fmt.Sprintf(`From: todo <process@erikwinter.nl>
msgStr := fmt.Sprintf(`From: todo <mstore@erikwinter.nl>
Date: %s
Subject: %s
%s`, subject, body)
%s`, time.Now().Format(time.RFC822), subject, body)
msg := NewBody(msgStr)