@@ -11,21 +11,26 @@ let makePathsForModule ~projectFilesAndPaths ~dependenciesFilesAndPaths =
11
11
Hashtbl. replace pathsForModule modName paths);
12
12
pathsForModule
13
13
14
+ let overrideRescriptVersion = ref None
15
+
14
16
let getReScriptVersion () =
15
- (* TODO: Include patch stuff when needed *)
16
- let defaultVersion = (11 , 0 ) in
17
- try
18
- let value = Sys. getenv " RESCRIPT_VERSION" in
19
- let version =
20
- match value |> String. split_on_char '.' with
21
- | major :: minor :: _rest -> (
22
- match (int_of_string_opt major, int_of_string_opt minor) with
23
- | Some major , Some minor -> (major, minor)
24
- | _ -> defaultVersion)
25
- | _ -> defaultVersion
26
- in
27
- version
28
- with Not_found -> defaultVersion
17
+ match ! overrideRescriptVersion with
18
+ | Some overrideRescriptVersion -> overrideRescriptVersion
19
+ | None -> (
20
+ (* TODO: Include patch stuff when needed *)
21
+ let defaultVersion = (11 , 0 ) in
22
+ try
23
+ let value = Sys. getenv " RESCRIPT_VERSION" in
24
+ let version =
25
+ match value |> String. split_on_char '.' with
26
+ | major :: minor :: _rest -> (
27
+ match (int_of_string_opt major, int_of_string_opt minor) with
28
+ | Some major , Some minor -> (major, minor)
29
+ | _ -> defaultVersion)
30
+ | _ -> defaultVersion
31
+ in
32
+ version
33
+ with Not_found -> defaultVersion)
29
34
30
35
let newBsPackage ~rootPath =
31
36
let rescriptJson = Filename. concat rootPath " rescript.json" in
0 commit comments