diff options
| author | Théo Zimmermann | 2018-05-22 10:30:51 +0200 |
|---|---|---|
| committer | Théo Zimmermann | 2018-05-22 10:30:51 +0200 |
| commit | 61e088161858fa7e6ff494cadd7362b9deccd438 (patch) | |
| tree | a88bf6867103dbf87d701cc2e2205e67b5f4e7d0 /ide/ideutils.ml | |
| parent | d6eb4a26648817f6b034e95c02622cadf0fa65ca (diff) | |
| parent | db1719fbac08b5582fafddd4b76ef92f69cc5bc1 (diff) | |
Merge PR #6859: [stm] Make toplevels standalone executables.
Diffstat (limited to 'ide/ideutils.ml')
| -rw-r--r-- | ide/ideutils.ml | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/ide/ideutils.ml b/ide/ideutils.ml index bdb39e94a1..e96b992999 100644 --- a/ide/ideutils.ml +++ b/ide/ideutils.ml @@ -289,16 +289,10 @@ let coqtop_path () = | Some s -> s | None -> match cmd_coqtop#get with - | Some s -> s - | None -> - try - let old_prog = Sys.executable_name in - let pos = String.length old_prog - 6 in - let i = Str.search_backward (Str.regexp_string "coqide") old_prog pos - in - let new_prog = Bytes.of_string old_prog in - Bytes.blit_string "coqtop" 0 new_prog i 6; - let new_prog = Bytes.to_string new_prog in + | Some s -> s + | None -> + try + let new_prog = System.get_toplevel_path "coqidetop" in if Sys.file_exists new_prog then new_prog else let in_macos_bundle = @@ -306,8 +300,8 @@ let coqtop_path () = (Filename.dirname new_prog) (Filename.concat "../Resources/bin" (Filename.basename new_prog)) in if Sys.file_exists in_macos_bundle then in_macos_bundle - else "coqtop" - with Not_found -> "coqtop" + else "coqidetop" + with Not_found -> "coqidetop" in file (* In win32, when a command-line is to be executed via cmd.exe |
