Fix fix for #20
This commit is contained in:
parent
132ddca42b
commit
6ae036a318
36
src/path.ml
36
src/path.ml
|
@ -307,30 +307,30 @@ let is_in_build_dir t =
|
||||||
String.is_prefix t ~prefix:build_prefix
|
String.is_prefix t ~prefix:build_prefix
|
||||||
|
|
||||||
let extract_build_context t =
|
let extract_build_context t =
|
||||||
if is_local t && String.is_prefix t ~prefix:build_prefix then
|
if String.is_prefix t ~prefix:build_prefix then
|
||||||
let i = String.length build_prefix in
|
let i = String.length build_prefix in
|
||||||
let j =
|
match String.index_from t i '/' with
|
||||||
match String.index_from t i '/' with
|
| exception _ ->
|
||||||
| exception _ -> String.length t
|
Some
|
||||||
| j -> j
|
(String.sub t ~pos:i ~len:(String.length t - i),
|
||||||
in
|
"")
|
||||||
Some
|
| j ->
|
||||||
(String.sub t ~pos:i ~len:(j - i),
|
Some
|
||||||
String.sub t ~pos:(j + 1) ~len:(String.length t - j - 1))
|
(String.sub t ~pos:i ~len:(j - i),
|
||||||
|
String.sub t ~pos:(j + 1) ~len:(String.length t - j - 1))
|
||||||
else
|
else
|
||||||
None
|
None
|
||||||
|
|
||||||
let extract_build_context_dir t =
|
let extract_build_context_dir t =
|
||||||
if is_local t && String.is_prefix t ~prefix:build_prefix then
|
if String.is_prefix t ~prefix:build_prefix then
|
||||||
let i = String.length build_prefix in
|
let i = String.length build_prefix in
|
||||||
let j =
|
match String.index_from t i '/' with
|
||||||
match String.index_from t i '/' with
|
| exception _ ->
|
||||||
| exception _ -> String.length t
|
Some (t, "")
|
||||||
| j -> j
|
| j ->
|
||||||
in
|
Some
|
||||||
Some
|
(String.sub t ~pos:0 ~len:j,
|
||||||
(String.sub t ~pos:0 ~len:j,
|
String.sub t ~pos:(j + 1) ~len:(String.length t - j - 1))
|
||||||
String.sub t ~pos:(j + 1) ~len:(String.length t - j - 1))
|
|
||||||
else
|
else
|
||||||
None
|
None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue