mirror of
https://github.com/daylinmorgan/tsm.git
synced 2024-11-16 09:18:32 -06:00
fix: add version override for nix
This commit is contained in:
parent
516d5ae814
commit
5991d93bcb
3 changed files with 15 additions and 6 deletions
|
@ -39,11 +39,14 @@
|
|||
};
|
||||
});
|
||||
packages = forAllSystems (pkgs: {
|
||||
tsm = pkgs.buildNimblePackage {
|
||||
tsm = pkgs.buildNimblePackage rec {
|
||||
pname = "tsm";
|
||||
version = "2024.1001";
|
||||
version = "2024.1001-unstable";
|
||||
src = ../.;
|
||||
nimbleDepsHash = "sha256-ugu+bNCWukWSALzD0/i73d0O2kty85J824tHsmfWRDI=";
|
||||
nimbleDepsHash = "sha256-1J0Wt/XjFiSN1MTfgg9tE5dY3GnXH/UgG3zCL19GgpU=";
|
||||
nimFlags = [
|
||||
"-d:TsmVersion=v${version}"
|
||||
];
|
||||
};
|
||||
default = self.packages.${pkgs.system}.tsm;
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import std/[os, sequtils, strformat, strutils, parsecfg, tables]
|
||||
import std/[os, sequtils, strformat, strutils, tables]
|
||||
import usu
|
||||
import term
|
||||
|
||||
|
|
10
src/tsm.nim
10
src/tsm.nim
|
@ -14,10 +14,16 @@ proc tsm(open: bool = false) =
|
|||
else:
|
||||
tmux.attach project.name
|
||||
|
||||
proc getVersion(): string =
|
||||
const tsmVersion {.strdefine.} = "unknown"
|
||||
const gitVersion = staticExec "git describe --tags --always HEAD --match 'v*'"
|
||||
when tsmVersion != "unknown": tsmVersion
|
||||
else: gitVersion
|
||||
|
||||
|
||||
when isMainModule:
|
||||
import cligen
|
||||
const vsn = staticExec "git describe --tags --always HEAD --match 'v*'"
|
||||
clCfg.version = vsn
|
||||
clCfg.version = getVersion()
|
||||
|
||||
if clCfg.helpAttr.len == 0:
|
||||
clCfg.helpAttr =
|
||||
|
|
Loading…
Reference in a new issue