diff --git a/Makefile b/Makefile index 75f6ced..661bfce 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ release: rnnoise mkdir -p tmp/.local/bin/ go generate - CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-s -w -extldflags "-static"' . + CGO_ENABLED=0 GOOS=linux go build -tags release -a -ldflags '-s -w -extldflags "-static"' . upx noisetorch mv noisetorch tmp/.local/bin/ cd tmp/; \ diff --git a/README.md b/README.md index f89f89b..08761fa 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,6 @@ Install the Go compiler from [golang.org](https://golang.org/). And make sure yo make # build it ``` -If you build from source, it's recommended that you disable automatic update checks. -In `~/.config/noisetorch/config.toml` set `EnableUpdates = false`. - ## Special thanks to * [xiph.org](https://xiph.org)/[Mozilla's](https://mozilla.org) excellent [RNNoise](https://jmvalin.ca/demo/rnnoise/). diff --git a/config.go b/config.go index de16249..b45e829 100644 --- a/config.go +++ b/config.go @@ -20,7 +20,10 @@ const configFile = "config.toml" func initializeConfigIfNot() { log.Println("Checking if config needs to be initialized") - conf := config{Threshold: 95, DisplayMonitorSources: false, EnableUpdates: true} + conf := config{Threshold: 95, DisplayMonitorSources: false, EnableUpdates: true} // if you're a package maintainer and you mess with this, we have a problem. + // Unless you set -tags release on the build the updater is *not* compiled in any. DO NOT MESS WITH THIS! + // This isn't and never was the proper location to disable the updater. + configdir := configDir() ok, err := exists(configdir) if err != nil { diff --git a/update.go b/update.go index 6b83406..aedf33c 100644 --- a/update.go +++ b/update.go @@ -1,3 +1,5 @@ +// +build release + package main import ( diff --git a/update_noop.go b/update_noop.go new file mode 100644 index 0000000..bdd7698 --- /dev/null +++ b/update_noop.go @@ -0,0 +1,28 @@ +// +build !release + +package main + +import "errors" + +type updateui struct { + serverVersion string + available bool + triggered bool + updatingText string +} + +func updateCheck(ctx *ntcontext) { + +} + +func update(ctx *ntcontext) { + +} + +func fetchFile(file string) ([]byte, error) { + return make([]byte, 0), errors.New("Disabled by build flags") +} + +func publickey() []byte { + return make([]byte, 0) +}