Skip to content

Commit

Permalink
revert #1124 (#1180)
Browse files Browse the repository at this point in the history
problem in the definition of Tool.Indexing.dbpath: "~" in "~/.LPSearch.db" is not interpreted as the HOME directory
we revert #1124 by calling getenv HOME again
in case getenv HOME fails, we use ".LPSearch.db"
  • Loading branch information
fblanqui authored Jan 22, 2025
1 parent 21ee7f3 commit ca1409f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ immediately stops on the first failure, without going to the next file

**Remark on index:**

The ``index`` command generates the file ``~/.LPSearch.db``. This file contains an indexation of all the symbols and rules occurring in the dk/lp files given in argument. By default, the file ``~/.LPSearch.db`` is erased first. To append new symbols and rules, use the option ``--add``. It is also possile to normalize terms wrt some rules before indexation by using ``--rules`` options.
The ``index`` command generates the file ``~/.LPSearch.db`` if ``$HOME`` is defined, and ``.LPSearch.db`` otherwise. This file contains an indexation of all the symbols and rules occurring in the dk/lp files given in argument. By default, the db file is erased first. To append new symbols and rules, use the option ``--add``. It is also possile to normalize terms wrt some rules before indexation by using ``--rules`` options.

**Remark on search:**

Expand Down
5 changes: 4 additions & 1 deletion src/tool/indexing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ module DB = struct

(* disk persistence *)

let dbpath = "~/.LPSearch.db"
let dbpath =
match Sys.getenv_opt "HOME" with
| Some s -> s ^ "/.LPSearch.db"
| None -> ".LPSearch.db"
let rwpaths = ref []

let restore_from_disk () =
Expand Down

0 comments on commit ca1409f

Please sign in to comment.