|
14 | 14 | # You should have received a copy of the GNU General Public License |
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
|
17 | | -import os |
18 | 17 | import shutil |
19 | 18 | import time |
20 | 19 | import jinja2 |
@@ -66,7 +65,7 @@ def compile( |
66 | 65 |
|
67 | 66 | out_dir = Path(out_dir, "wwise") |
68 | 67 | if not out_dir.exists(): |
69 | | - os.makedirs(out_dir) |
| 68 | + out_dir.mkdir() |
70 | 69 |
|
71 | 70 | env = jinja2.Environment() |
72 | 71 | env.loader = jinja2.FileSystemLoader( |
@@ -104,15 +103,15 @@ def compile( |
104 | 103 |
|
105 | 104 | src_ext_list = ["h", "hpp", "c", "cpp", "xml", "def", "rc", "lua", "json"] |
106 | 105 | for f in env.list_templates(extensions=src_ext_list): |
107 | | - file_dir = Path(out_dir, os.path.dirname(f)) |
108 | | - file_name = os.path.basename(f) |
| 106 | + file = Path(f) |
| 107 | + file_dir = Path(out_dir, file.parent) |
109 | 108 |
|
110 | | - file_name = file_name.replace("{{name}}", patch_name) |
| 109 | + file_name = file.name.replace("{{name}}", patch_name) |
111 | 110 | file_name = file_name.replace("{{plugin_type}}", plugin_type) |
112 | 111 | file_path = Path(file_dir, file_name) |
113 | 112 |
|
114 | 113 | if not file_path.parent.exists(): |
115 | | - os.makedirs(file_path.parent) |
| 114 | + file_path.parent.mkdir(parents=True) |
116 | 115 |
|
117 | 116 | with open(file_path, "w") as g: |
118 | 117 | g.write(env.get_template(f).render( |
|
0 commit comments