Skip to content

Commit

Permalink
✨ env ENTARI_CONFIG_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Dec 27, 2024
1 parent 38314be commit 64b087a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions arclet/entari/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

JSON_PLUGIN_COMMON_TEMPLATE = """\
"plugins": {
"~record_message": {},
".record_message": {},
"::echo": {},
"::inspect": {}
}
Expand All @@ -49,7 +49,10 @@
"$prelude": [
"::auto_reload"
],
"~record_message": {},
".record_message": {
"record_send": true,
},
"::help": {},
"::echo": {},
"::inspect": {},
"::auto_reload": {
Expand Down Expand Up @@ -83,8 +86,10 @@
plugins:
$prelude:
- ::auto_reload
.record_message: {}
.record_message:
record_send: true
::echo: {}
::help: {}
::inspect: {}
::auto_reload:
watch_config: true
Expand Down
10 changes: 5 additions & 5 deletions arclet/entari/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def reload(self):
@classmethod
def load(cls, path: str | os.PathLike[str] | None = None) -> EntariConfig:
if path is None:
try:
import yaml

_path = Path.cwd() / "entari.yml"
except ImportError:
if "ENTARI_CONFIG_FILE" in os.environ:
_path = Path(os.environ["ENTARI_CONFIG_FILE"])
elif (Path.cwd() / ".entari.json").exists():
_path = Path.cwd() / ".entari.json"
else:
_path = Path.cwd() / "entari.yml"
else:
_path = Path(path)
if not _path.exists():
Expand Down

0 comments on commit 64b087a

Please sign in to comment.