@danhachuel/thunderbolt 0.6.42 → 0.6.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/app/main.py +22 -0
  2. package/package.json +1 -1
package/app/main.py CHANGED
@@ -39,6 +39,28 @@ import streamlit as st
39
39
  ROOT = Path(__file__).resolve().parents[1]
40
40
  if str(ROOT) not in sys.path:
41
41
  sys.path.insert(0, str(ROOT))
42
+
43
+
44
+ def _load_local_env() -> None:
45
+ for env_path in (ROOT / ".env", Path.cwd() / ".env"):
46
+ try:
47
+ if not env_path.is_file():
48
+ continue
49
+ for raw_line in env_path.read_text(encoding="utf-8").splitlines():
50
+ line = raw_line.strip()
51
+ if not line or line.startswith("#") or "=" not in line:
52
+ continue
53
+ key, value = line.split("=", 1)
54
+ key = key.strip()
55
+ value = value.strip().strip("'\"")
56
+ if key:
57
+ os.environ.setdefault(key, value)
58
+ except OSError as exc:
59
+ print(f"DEBUG: não foi possível ler {env_path}: {exc}")
60
+
61
+
62
+ _load_local_env()
63
+
42
64
  try:
43
65
  APP_VERSION = json.loads((ROOT / "package.json").read_text(encoding="utf-8")).get("version", "")
44
66
  except (OSError, json.JSONDecodeError):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.6.42",
3
+ "version": "0.6.43",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",