fix: expand ~ for workspace files and ignore backend tilde dir
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -17,3 +17,6 @@ node_modules/
|
|||||||
|
|
||||||
# Worktrees
|
# Worktrees
|
||||||
.worktrees/
|
.worktrees/
|
||||||
|
|
||||||
|
# Accidental literal "~" directories (e.g. when a configured path contains "~" but isn't expanded)
|
||||||
|
backend/~/
|
||||||
|
|||||||
@@ -130,7 +130,9 @@ def _ensure_workspace_file(
|
|||||||
) -> None:
|
) -> None:
|
||||||
if not workspace_path or not name:
|
if not workspace_path or not name:
|
||||||
return
|
return
|
||||||
root = Path(workspace_path)
|
# `gateway.workspace_root` is sometimes configured as `~/.openclaw`.
|
||||||
|
# Expand user here to avoid creating a literal `./~` directory under the backend cwd.
|
||||||
|
root = Path(workspace_path).expanduser()
|
||||||
path = root / name
|
path = root / name
|
||||||
if not overwrite and path.exists():
|
if not overwrite and path.exists():
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user