Skip to content

Commit

Permalink
Move env variable for pack path to config
Browse files Browse the repository at this point in the history
  • Loading branch information
rrooij committed Jun 12, 2020
1 parent 155e127 commit 37286d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions config/terminus_config.pl
Expand Up @@ -12,6 +12,7 @@
console_base_url/1,
ssl_cert/1,
ssl_cert_key/1,
pack_dir/1,
https_enabled/0,
tmp_path/1,
server_worker_options/1,
Expand Down Expand Up @@ -61,6 +62,9 @@
ssl_cert_key(Value) :-
getenv_default('TERMINUSDB_SSL_CERT_KEY', 'localhost.key', Value).

pack_dir(Value) :-
getenv('TERMINUSDB_SERVER_PACK_DIR', Value).

registry_path(Value) :-
once(expand_file_search_path(plugins('registry.pl'), Path)),
getenv_default('TERMINUSDB_SERVER_REGISTRY_PATH', Path, Value).
Expand Down
15 changes: 8 additions & 7 deletions load_paths.pl
@@ -1,13 +1,6 @@
:- dynamic user:file_search_path/2.
:- multifile user:file_search_path/2.

add_pack_path :-
( getenv('TERMINUS_SERVER_PACK_DIR', PackDir)
-> attach_packs(PackDir)
; true).

:- add_pack_path.

add_terminus_home_path :-
prolog_load_context(file, File),
file_directory_name(File, Dir),
Expand Down Expand Up @@ -50,6 +43,14 @@

:- add_config_path.

add_pack_path :-
use_module(config(terminus_config)),
( pack_dir(PackDir)
-> attach_packs(PackDir)
; true).

:- add_pack_path.

add_test_path :-
user:file_search_path(terminus_home, Dir),
atom_concat(Dir,'/test',Config),
Expand Down

0 comments on commit 37286d8

Please sign in to comment.