Change Version so it can be set at compile time. @extensions

This commit is contained in:
Sean E. Russell 2020-03-03 05:47:52 -06:00
parent 8642e94d90
commit 9f67cdf773
3 changed files with 17 additions and 4 deletions

View File

@ -28,8 +28,6 @@ import (
const (
appName = "gotop"
// TODO: Set this at compile time; having to check this in sucks.
version = "3.4.5"
graphHorizontalScaleDelta = 3
defaultUI = "cpu\ndisk/1 2:mem/2\ntemp\nnet procs"
@ -39,6 +37,8 @@ const (
)
var (
// TODO: Set this at compile time; having to check this in sucks.
Version = "3.4.5"
conf gotop.Config
help *w.HelpMenu
bar *w.StatusBar
@ -50,7 +50,6 @@ var (
// TODO: state:merge #135 linux console font (cmatsuoka/console-font)
// TODO: state:deferred 157 FreeBSD fixes & Nvidia GPU support (kraust/master). Significant CPU use impact for NVidia changes.
// TODO: Virtual devices from Prometeus metrics @feature
// TODO: state:merge #167 configuration file (jrswab/configFile111)
// TODO: Abstract out the UI toolkit. mum4k/termdash, VladimirMarkelov/clui, gcla/gowid, rivo/tview, marcusolsson/tui-go might work better for some OS/Archs. Performance/memory use comparison would be interesting.
func parseArgs(conf *gotop.Config) error {
usage := `
@ -97,7 +96,7 @@ Colorschemes:
return err
}
args, err := docopt.ParseArgs(usage, os.Args[1:], version)
args, err := docopt.ParseArgs(usage, os.Args[1:], Version)
if err != nil {
return err
}

View File

@ -1,5 +1,7 @@
package devices
// TODO: https://github.com/elastic/go-sysinfo
import (
"log"
"time"

View File

@ -14,3 +14,15 @@ credentials to aurpublish to the AUR repository, so the final publish step is
still currently manual.
Oh, what a tangled web.
Nix adds new and interesting complexities to the release.
1. cd to the nixpkgs directory
2. docker run -it --rm --mount type=bind,source="\$(pwd)",target=/mnt nixos/nix sh
3. cd /mnt
4. nix-prefetch-url --unpack https://github.com/xxxserxxx/gotop/archive/v3.3.2.tar.gz
5. Copy the sha256
6. Update the version and hash in nixpkgs/pkgs/tools/system/gotop/default.nix
8. In docker, install & run vgo2nix to update deps.nix
7. nix-build -A gotop