fix: resolve CI test failure in output.py
- Fixed undefined 'tool' variable in display_history function - Changed '[tool]' markup tag usage to proper Rich syntax - All tests now pass (38/38 unit tests) - Type checking passes with mypy --strict
This commit is contained in:
29
shell_speak/config.py
Normal file
29
shell_speak/config.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Configuration module for shell-speak."""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_data_dir() -> Path:
|
||||
"""Get the data directory for shell-speak."""
|
||||
return Path(os.environ.get("SHELL_SPEAK_DATA_DIR", "~/.local/share/shell-speak")).expanduser()
|
||||
|
||||
|
||||
def get_history_file() -> Path:
|
||||
"""Get the path to the command history file."""
|
||||
return Path(os.environ.get("SHELL_SPEAK_HISTORY_FILE", "~/.local/share/shell-speak/history.json")).expanduser()
|
||||
|
||||
|
||||
def get_corrections_file() -> Path:
|
||||
"""Get the path to the user corrections file."""
|
||||
return Path(os.environ.get("SHELL_SPEAK_CORRECTIONS_FILE", "~/.local/share/shell-speak/corrections.json")).expanduser()
|
||||
|
||||
|
||||
def ensure_data_dir() -> Path:
|
||||
"""Ensure the data directory exists."""
|
||||
data_dir = get_data_dir()
|
||||
data_dir.mkdir(parents=True, exist_ok=True)
|
||||
return data_dir
|
||||
|
||||
|
||||
DEFAULT_TOOLS = ["docker", "kubectl", "git", "unix"]
|
||||
Reference in New Issue
Block a user