mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-10 13:37:55 -05:00
fix path issues on windows
This commit is contained in:
@@ -136,7 +136,7 @@ class LocalDiskVFS(VirtualFileSystem):
|
||||
self.ignore_matcher = ignore_matcher
|
||||
|
||||
def get_full_path(self, path: str) -> str:
|
||||
return os.path.normpath(os.path.join(self.root, path))
|
||||
return os.path.abspath(os.path.normpath(os.path.join(self.root, path)))
|
||||
|
||||
def save(self, path: str, content: str):
|
||||
full_path = self.get_full_path(path)
|
||||
|
||||
@@ -382,8 +382,8 @@ class StateManager:
|
||||
try:
|
||||
return LocalDiskVFS(root, allow_existing=load_existing, ignore_matcher=ignore_matcher)
|
||||
except FileExistsError:
|
||||
log.warning(f"Directory {root} already exists, changing project folder to {self.project.folder_name}")
|
||||
self.project.folder_name = self.project.folder_name + "-" + uuid4().hex[:7]
|
||||
log.warning(f"Directory {root} already exists, changing project folder to {self.project.folder_name}")
|
||||
await self.current_session.commit()
|
||||
|
||||
def get_full_project_root(self) -> str:
|
||||
|
||||
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from os import walk
|
||||
from os.path import join, relpath
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
@@ -93,7 +94,7 @@ class Renderer:
|
||||
for file in files:
|
||||
file_path = join(path, file) # actual full path of the template file
|
||||
tpl_location = relpath(file_path, self.template_dir) # template relative to template_dir
|
||||
output_location = relpath(file_path, full_root) # template relative to tree root
|
||||
output_location = Path(file_path).relative_to(full_root).as_posix() # template relative to tree root
|
||||
|
||||
if filter:
|
||||
output_location = filter(output_location)
|
||||
|
||||
Reference in New Issue
Block a user