@@ -120,12 +120,12 @@ def get_files(self) -> dict[str, 'TemplateFile']:
120120
121121 full_path = os .path .join (path , fname )
122122
123- rel_path = full_path . replace ( templates_path , '' ). lstrip ( '/' )
123+ rel_path = os . path . relpath ( full_path , templates_path )
124124
125125 template_file = TemplateFile (
126126 template = self ,
127127 path_full = full_path ,
128- path_rel = rel_path ,
128+ path_rel = rel_path . replace ( os . sep , '/' ) ,
129129 )
130130
131131 rel_path = rel_path .replace (maker .package_dir_marker , maker .settings ['package_name' ])
@@ -174,9 +174,9 @@ def _find(cls, name_or_path: str, search_paths: tuple[str, ...]) -> tuple[str, s
174174
175175 """
176176 for supposed_path in search_paths :
177- if '/' in supposed_path and os .path .exists (supposed_path ):
177+ if os . sep in supposed_path and os .path .exists (supposed_path ):
178178 path = str (os .path .abspath (supposed_path ))
179- return path .split ('/' )[- 1 ], path
179+ return path .split (os . sep )[- 1 ], path
180180
181181 raise AppMakerException (
182182 f"Unable to find application template { name_or_path } . "
@@ -221,7 +221,7 @@ def parent_paths(self):
221221
222222 if os .path .exists (path_full ):
223223 # Check parent file exists in template.
224- paths .append (os . path . join ( parent .name , path_rel ) )
224+ paths .append (f' { parent .name } / { path_rel } ' )
225225
226226 if parent .is_default :
227227 break
0 commit comments