mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 10:42:53 +00:00
d5c1ecc104
To help with #15595 changes, refactoring is required. In this PR we switch from config to env vars. Doing some cleanup meanwhile.
15 lines
551 B
Nix
15 lines
551 B
Nix
{ lib }:
|
|
|
|
version:
|
|
let
|
|
# paths don't like slashes in them
|
|
dropSlashes = builtins.replaceStrings [ "/" ] [ "_" ];
|
|
# if version doesn't match this it's probably a commit, it's lax semver
|
|
versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+[[:alnum:]+_.-]*$";
|
|
in
|
|
if (builtins.match versionRegex version) != null
|
|
# Geth forces a 'v' prefix for all versions
|
|
then lib.removePrefix "v" (dropSlashes version)
|
|
# reduce metrics cardinality in Prometheus
|
|
else lib.traceValFn (_: "WARNING: Marking build version as 'develop'!") "develop"
|