Skip to content

Commit

Permalink
Logging & fixes of launching bin commands
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau committed Feb 28, 2019
1 parent a56304a commit c7351f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions publish/publishing.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,10 @@ def _run_bin(self, cwd: pathlib.Path, cmd: str, *args):
:return:
"""
os.chdir(str(cwd))
full_cmd = f'{cmd} {" ".join(args)}'
logger.info(f'Running shell command "{full_cmd}" with cwd={cwd}')

r = subprocess.run(f'{cmd} {" ".join(args)}', shell=True, capture_output=True)
r = subprocess.run(full_cmd, shell=True, capture_output=True)

if r.returncode != 0:
r.stderr and logger.debug(f'STDERR: {r.stderr.decode("utf-8")}')
Expand All @@ -351,7 +353,7 @@ def publish_repo(self) -> None:
"""
path = self._clone_repo()

if self.build_bin is not None:
if self.build_bin:
self._run_bin(path, self.build_bin)

self._remove_ignored_files(path)
Expand All @@ -370,7 +372,7 @@ def publish_repo(self) -> None:
if self.ipns_key is not None:
self.publish_name()

if self.after_publish_bin is not None:
if self.after_publish_bin:
self._run_bin(path, self.after_publish_bin, self.last_ipfs_addr)

self._cleanup_repo(path)
Expand Down

0 comments on commit c7351f1

Please sign in to comment.