Completely decouple runtime AppletDiscovery from local workspace paths

This commit is contained in:
Gravitiny Team
2026-10-04 07:28:03 +03:00
parent 82f8db7662
commit 6d904b1ba9
2 changed files with 10 additions and 35 deletions
+1 -7
View File
@@ -16,13 +16,7 @@ class AppletDiscovery:
if custom_applets_dir:
self.search_dirs.append(Path(custom_applets_dir))
# 1. Local workspace applets directory
base_dir = Path(__file__).resolve().parent.parent
workspace_applets = base_dir / "applets"
if workspace_applets.exists():
self.search_dirs.append(workspace_applets)
# 2. User home applets directory (~/.gravitiny/applets)
# Only search the user home installed applets directory (~/.gravitiny/applets)
user_applets = Path.home() / ".gravitiny" / "applets"
if user_applets.exists() and user_applets not in self.search_dirs:
self.search_dirs.append(user_applets)
-19
View File
@@ -129,21 +129,8 @@ class ShimGenerator:
is_windows = os.name == "nt"
python_exe = self._get_python_interpreter()
# Locate core entrypoint
user_home = Path.home()
core_main = user_home / ".gravitiny" / "core" / "main.py"
if not core_main.exists():
core_main = Path(__file__).resolve().parent.parent / "main.py"
if is_windows:
shim_file = self.bin_dir / f"{clean_name}.cmd"
if core_main.exists():
content = (
"@echo off\n"
"setlocal\n"
f'"{python_exe}" "{core_main}" %*\n'
)
else:
content = (
"@echo off\n"
"setlocal\n"
@@ -153,12 +140,6 @@ class ShimGenerator:
f.write(content)
else:
shim_file = self.bin_dir / clean_name
if core_main.exists():
content = (
"#!/usr/bin/env sh\n"
f'exec "{python_exe}" "{core_main}" "$@"\n'
)
else:
content = (
"#!/usr/bin/env sh\n"
f'exec "{python_exe}" -m gravitiny "$@"\n'