Skip to content

Commit 64b087a

Browse files
committed
✨ env ENTARI_CONFIG_FILE
1 parent 38314be commit 64b087a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Diff for: arclet/entari/__main__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
JSON_PLUGIN_COMMON_TEMPLATE = """\
3939
"plugins": {
40-
"~record_message": {},
40+
".record_message": {},
4141
"::echo": {},
4242
"::inspect": {}
4343
}
@@ -49,7 +49,10 @@
4949
"$prelude": [
5050
"::auto_reload"
5151
],
52-
"~record_message": {},
52+
".record_message": {
53+
"record_send": true,
54+
},
55+
"::help": {},
5356
"::echo": {},
5457
"::inspect": {},
5558
"::auto_reload": {
@@ -83,8 +86,10 @@
8386
plugins:
8487
$prelude:
8588
- ::auto_reload
86-
.record_message: {}
89+
.record_message:
90+
record_send: true
8791
::echo: {}
92+
::help: {}
8893
::inspect: {}
8994
::auto_reload:
9095
watch_config: true

Diff for: arclet/entari/config.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ def reload(self):
5151
@classmethod
5252
def load(cls, path: str | os.PathLike[str] | None = None) -> EntariConfig:
5353
if path is None:
54-
try:
55-
import yaml
56-
57-
_path = Path.cwd() / "entari.yml"
58-
except ImportError:
54+
if "ENTARI_CONFIG_FILE" in os.environ:
55+
_path = Path(os.environ["ENTARI_CONFIG_FILE"])
56+
elif (Path.cwd() / ".entari.json").exists():
5957
_path = Path.cwd() / ".entari.json"
58+
else:
59+
_path = Path.cwd() / "entari.yml"
6060
else:
6161
_path = Path(path)
6262
if not _path.exists():

0 commit comments

Comments
 (0)