diff options
author | Badlop <badlop@process-one.net> | 2022-05-30 11:46:19 +0200 |
---|---|---|
committer | badlop <badlop@gmail.com> | 2022-10-24 12:35:30 +0200 |
commit | 8ea7690fc56fb1cb07ff1ba23385db293ae95e41 (patch) | |
tree | 38eb961d054c0bc477b4b16d38c559a348aa8320 /src/misc.erl | |
parent | Update changelog (diff) |
Support @VERSION@ and @SEMVER@ in captcha_cmd option
Diffstat (limited to '')
-rw-r--r-- | src/misc.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/misc.erl b/src/misc.erl index 232e0ea33..fcdf61d9a 100644 --- a/src/misc.erl +++ b/src/misc.erl @@ -43,7 +43,7 @@ get_my_ipv4_address/0, get_my_ipv6_address/0, parse_ip_mask/1, crypto_hmac/3, crypto_hmac/4, uri_parse/1, match_ip_mask/3, format_hosts_list/1, format_cycle/1, delete_dir/1, - logical_processors/0]). + semver_to_xxyy/1, logical_processors/0]). %% Deprecated functions -export([decode_base64/1, encode_base64/1]). @@ -621,6 +621,16 @@ delete_dir(Dir) -> {error, Error} end. +-spec semver_to_xxyy(binary()) -> binary(). +semver_to_xxyy(<<Y1, Y2, $., M2, $., $0>>) -> + <<Y1, Y2, $., $0, M2>>; +semver_to_xxyy(<<Y1, Y2, $., M2, $., Patch/binary>>) -> + <<Y1, Y2, $., $0, M2, $., Patch/binary>>; +semver_to_xxyy(<<Y1, Y2, $., M1, M2, $., $0>>) -> + <<Y1, Y2, $., M1, M2>>; +semver_to_xxyy(Version) when is_binary(Version) -> + Version. + %%%=================================================================== %%% Internal functions %%%=================================================================== |