lib/versions: expose splitVersion
This commit is contained in:
parent
d484f2b7fc
commit
fd3052901c
|
@ -134,5 +134,7 @@ let
|
||||||
mergeAttrsByFuncDefaultsClean mergeAttrBy
|
mergeAttrsByFuncDefaultsClean mergeAttrBy
|
||||||
fakeSha256 fakeSha512
|
fakeSha256 fakeSha512
|
||||||
nixType imap;
|
nixType imap;
|
||||||
|
inherit (versions)
|
||||||
|
splitVersion;
|
||||||
});
|
});
|
||||||
in lib
|
in lib
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
/* Version string functions. */
|
/* Version string functions. */
|
||||||
{ lib }:
|
{ lib }:
|
||||||
|
|
||||||
let
|
rec {
|
||||||
|
|
||||||
|
/* Break a version string into its component parts.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
splitVersion "1.2.3"
|
||||||
|
=> ["1" "2" "3"]
|
||||||
|
*/
|
||||||
splitVersion = builtins.splitVersion or (lib.splitString ".");
|
splitVersion = builtins.splitVersion or (lib.splitString ".");
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
/* Get the major version string from a string.
|
/* Get the major version string from a string.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
Loading…
Reference in New Issue