adelie-ai 0.2.10 → 0.2.11
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.
package/adelie/__init__.py
CHANGED
|
@@ -84,7 +84,13 @@ def cmd_init(args) -> None:
|
|
|
84
84
|
"""Initialize a new Adelie workspace."""
|
|
85
85
|
from adelie import registry
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
# Resolve relative to user's actual CWD (ADELIE_CWD), not the Python process
|
|
88
|
+
# cwd (which is set to PKG_ROOT so that 'from adelie import ...' works).
|
|
89
|
+
import os
|
|
90
|
+
user_cwd = Path(os.environ.get("ADELIE_CWD", os.getcwd())).resolve()
|
|
91
|
+
raw_dir = args.directory if args.directory != "." else str(user_cwd)
|
|
92
|
+
target = (user_cwd / raw_dir).resolve() if not Path(raw_dir).is_absolute() else Path(raw_dir).resolve()
|
|
93
|
+
|
|
88
94
|
adelie_dir = target / ".adelie"
|
|
89
95
|
|
|
90
96
|
if adelie_dir.exists() and not args.force:
|