Skip to content

Commit 5356c01

Browse files
brenmousdbantymaxkomarychev
authored
fix!: run post_hooks in package directory instead of current directory if meta=none [#696, #697]. Thanks @brenmous and @wallagib!
Co-authored-by: Dylan Anthony <[email protected]> Co-authored-by: Max Komarychev <[email protected]>
1 parent de7ff75 commit 5356c01

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: openapi_python_client/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,8 @@ def _run_command(self, cmd: str) -> None:
155155
)
156156
return
157157
try:
158-
subprocess.run(
159-
cmd, cwd=self.project_dir, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True
160-
)
158+
cwd = self.package_dir if self.meta == MetaType.NONE else self.project_dir
159+
subprocess.run(cmd, cwd=cwd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True)
161160
except CalledProcessError as err:
162161
self.errors.append(
163162
GeneratorError(

0 commit comments

Comments
 (0)