mirror of
https://github.com/PR0M3TH3AN/VoxVera.git
synced 2026-10-27 17:50:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec0abd856c |
No files matched your search
+1
-1
@@ -14,7 +14,7 @@ voxvera = ["templates/**", "src/**", "resources/**", "locales/**", "resources/bi
|
||||
|
||||
[project]
|
||||
name = "voxvera"
|
||||
version = "0.3.9"
|
||||
version = "0.3.10"
|
||||
description = "VoxVera CLI utilities"
|
||||
readme = "README.md"
|
||||
authors = [{name = "VoxVera"}]
|
||||
|
||||
Binary file not shown.
@@ -115,6 +115,23 @@ def test_init_seeds_missing_default_config(tmp_path, monkeypatch):
|
||||
assert saved["content"] == "Fresh content"
|
||||
|
||||
|
||||
def test_init_noninteractive_does_not_prompt_for_language(tmp_path, monkeypatch):
|
||||
_setup_tmp(monkeypatch, tmp_path)
|
||||
test_data_dir = tmp_path / "data"
|
||||
config_path = test_data_dir / "fresh-config.json"
|
||||
|
||||
def _fail_choose_language(*args, **kwargs):
|
||||
raise AssertionError("choose_language should not run for non-interactive init")
|
||||
|
||||
monkeypatch.setattr(cli, "choose_language", _fail_choose_language)
|
||||
|
||||
cli.main(["--config", str(config_path), "init", "--non-interactive"])
|
||||
|
||||
saved = cli.load_config(config_path)
|
||||
assert saved["lang"] == "en"
|
||||
assert (test_data_dir / "host" / saved["folder_name"] / "index.html").exists()
|
||||
|
||||
|
||||
def test_create_from_template_persists_current_language(tmp_path, monkeypatch):
|
||||
_setup_tmp(monkeypatch, tmp_path)
|
||||
cli.load_locale("es")
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
__version__ = "0.3.9"
|
||||
__version__ = "0.3.10"
|
||||
|
||||
# Add the vendor directory to sys.path ONLY for PyInstaller (frozen) builds.
|
||||
# For pip/pipx installs the system/venv packages are correct and the vendored
|
||||
|
||||
+15
-1
@@ -2043,7 +2043,10 @@ def main(argv=None):
|
||||
pass
|
||||
|
||||
if not current_lang and args.command in ("init", "quickstart", "manage"):
|
||||
current_lang = choose_language()
|
||||
if getattr(args, "non_interactive", False):
|
||||
current_lang = "en"
|
||||
else:
|
||||
current_lang = choose_language()
|
||||
# Save choice to config if possible
|
||||
if config_path.exists():
|
||||
config_data["lang"] = current_lang
|
||||
@@ -2077,6 +2080,11 @@ def main(argv=None):
|
||||
copy_template(args.template)
|
||||
return
|
||||
ensure_config_exists(config_path)
|
||||
if current_lang:
|
||||
config_data = load_config(str(config_path))
|
||||
if not config_data.get("lang"):
|
||||
config_data["lang"] = current_lang
|
||||
save_config(config_data, str(config_path))
|
||||
if not args.non_interactive:
|
||||
interactive_update(config_path)
|
||||
build_assets(config_path)
|
||||
@@ -2108,6 +2116,12 @@ def main(argv=None):
|
||||
else:
|
||||
install_autostart()
|
||||
elif args.command == "quickstart":
|
||||
ensure_config_exists(config_path)
|
||||
if current_lang:
|
||||
config_data = load_config(str(config_path))
|
||||
if not config_data.get("lang"):
|
||||
config_data["lang"] = current_lang
|
||||
save_config(config_data, str(config_path))
|
||||
if not args.non_interactive:
|
||||
if not sys.stdin.isatty():
|
||||
print(
|
||||
|
||||
Reference in new issue
Block a user