aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/feed/mail.go3
-rw-r--r--main.go3
-rw-r--r--pkg/config/config.go10
-rw-r--r--pkg/version/version.go11
4 files changed, 15 insertions, 12 deletions
diff --git a/internal/feed/mail.go b/internal/feed/mail.go
index 290c965..2b0cdf7 100644
--- a/internal/feed/mail.go
+++ b/internal/feed/mail.go
@@ -20,6 +20,7 @@ import (
"github.com/Necoro/feed2imap-go/internal/msg"
"github.com/Necoro/feed2imap-go/pkg/config"
"github.com/Necoro/feed2imap-go/pkg/log"
+ "github.com/Necoro/feed2imap-go/pkg/version"
)
func address(name, address string) []*mail.Address {
@@ -54,7 +55,7 @@ func (item *item) buildHeader() message.Header {
h.SetContentType("multipart/alternative", nil)
h.SetAddressList("From", item.fromAddress())
h.SetAddressList("To", item.toAddress())
- h.Set(msg.VersionHeader, config.Version())
+ h.Set(msg.VersionHeader, version.Version())
h.Set(msg.ReasonHeader, strings.Join(item.reasons, ","))
h.Set(msg.IdHeader, item.id())
h.Set("Message-Id", item.messageId())
diff --git a/main.go b/main.go
index 074c14b..b959076 100644
--- a/main.go
+++ b/main.go
@@ -10,6 +10,7 @@ import (
"github.com/Necoro/feed2imap-go/internal/imap"
"github.com/Necoro/feed2imap-go/pkg/config"
"github.com/Necoro/feed2imap-go/pkg/log"
+ "github.com/Necoro/feed2imap-go/pkg/version"
)
var printVersion = flag.Bool("version", false, "print version and exit")
@@ -51,7 +52,7 @@ func processFeed(feed *feed.Feed, client *imap.Client, dryRun bool) {
func run() error {
flag.Parse()
if *printVersion {
- println("Feed2Imap-Go, version " + config.Version())
+ println("Feed2Imap-Go, version " + version.Version())
return nil
}
diff --git a/pkg/config/config.go b/pkg/config/config.go
index eec2751..8d97a56 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -5,7 +5,6 @@ import (
"os"
"os/user"
"runtime"
- "runtime/debug"
"strings"
"github.com/Necoro/feed2imap-go/pkg/log"
@@ -95,15 +94,6 @@ func (opt GlobalOptions) WithPartHtml() bool {
return util.StrContains(opt.Parts, "html")
}
-// Current feed2imap version
-func Version() string {
- bi, ok := debug.ReadBuildInfo()
- if !ok {
- return "(unknown)"
- }
- return bi.Main.Version
-}
-
// Load configuration from file
func Load(path string) (*Config, error) {
log.Printf("Reading configuration file '%s'", path)
diff --git a/pkg/version/version.go b/pkg/version/version.go
new file mode 100644
index 0000000..81de2fc
--- /dev/null
+++ b/pkg/version/version.go
@@ -0,0 +1,11 @@
+package version
+
+// the way via debug.BuildInfo does not work -- it'll always return "devel"
+// thus the oldschool way: hardcoded
+
+const version = "0.1.0-devel"
+
+// Current feed2imap version
+func Version() string {
+ return version
+}
of the mailRené 'Necoro' Neumann7-18/+199 2020-04-20Fixes and validationRené 'Necoro' Neumann6-28/+25 2020-04-20Fix vettingRené 'Necoro' Neumann1-1/+1 2020-04-20Started with mail creationRené 'Necoro' Neumann4-3/+126 2020-04-20FeeditemsRené 'Necoro' Neumann2-2/+14 2020-04-20GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1