Skip to content

Commit cea0876

Browse files
author
David Souther
committed
Changes locally testing
1 parent 04dfd3e commit cea0876

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8
1+
3.9

aws_doc_sdk_examples_tools/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def copy_doc_gen(self):
3535
raise
3636

3737
def write_snippets(self):
38-
write_snippets(self.dest / self.doc_gen_folder / self.snippet_files_folder, self._doc_gen.snippets)
38+
write_snippets(self.dest / self.doc_gen_folder / self.snippet_files_folder, self._doc_gen.snippets, self.fs)
3939

4040
def run(self):
4141
logger.debug("Copying docgen files...")

aws_doc_sdk_examples_tools/fs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def list(self, path: Path) -> List[Path]:
5252
def copytree(self, source: Path, dest: Path):
5353
pass
5454

55+
5556
class PathFs(Fs):
5657
def glob(self, path: Path, glob: str) -> Generator[Path, None, None]:
5758
return path.glob(glob)
@@ -65,6 +66,7 @@ def readlines(self, path: Path, encoding: str = "utf-8") -> List[str]:
6566
return file.readlines()
6667

6768
def write(self, path: Path, content: str):
69+
self.mkdir(path.parent)
6870
with path.open("w", encoding="utf-8") as file:
6971
file.write(content)
7072

@@ -82,9 +84,9 @@ def list(self, path: Path) -> List[Path]:
8284
if self.stat(path).is_file:
8385
return []
8486
return [path / name for name in listdir(path)]
85-
87+
8688
def copytree(self, source: Path, dest: Path):
87-
shutil.copytree(source, dest)
89+
shutil.copytree(source, dest, dirs_exist_ok=True)
8890

8991

9092
class RecordFs(Fs):

0 commit comments

Comments
 (0)