Skip to content

Commit 959bdcd

Browse files
committed
fix version parser
1 parent 53dd0e6 commit 959bdcd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

etc/version_parser.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ let is_number x = try let _ = int_of_string x in true with _ -> false ;;
33

44
let main () =
55
let v = Sys.argv.(1) in
6-
let l = String.split_on_char '.' Str.(replace_first (regexp "^v") "" v) in
6+
let v' = Str.(replace_first (regexp "^v") "" v) in (* v1.20... -> 1.20... *)
7+
let v' = Str.(replace_first (regexp "-.*$") "" v') in (* ...-10-fjdnfs -> ... *)
8+
let l = String.split_on_char '.' v' in
79
(* sanitization *)
810
let l =
911
match l with

0 commit comments

Comments
 (0)