Skip to content

Commit 78aa60a

Browse files
committed
fix: attempting to get post gen to properly run
1 parent 5620697 commit 78aa60a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hooks/post_gen_project.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import shutil
44
import stat
5+
import tempfile
56
from pathlib import Path
67
from typing import Any
78
from typing import Callable
@@ -42,6 +43,10 @@ def remove_undesired_files() -> None:
4243
4344
This is done to avoid issues that tend to arise when the name of the template file contains a conditional.
4445
"""
46+
tmp_dir_root: Path = Path(tempfile.gettempdir()).parent
47+
if Path.cwd().is_relative_to(tmp_dir_root):
48+
return
49+
4550
for path in REMOVE_PATHS:
4651
if path == "":
4752
continue

0 commit comments

Comments
 (0)