Skip to content

Commit

Permalink
fix(installation script): Make library installation debuggable.
Browse files Browse the repository at this point in the history
  • Loading branch information
SingularisArt committed May 12, 2024
1 parent 433c00f commit 202b146
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak
Binary file not shown.
4 changes: 2 additions & 2 deletions man/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def join(*args, seperator="/"):


def symlink(location, destination):
os.system("rm -rf {}".format(destination))
os.makedirs(os.path.dirname(destination), exist_ok=True)
os.removedirs(destination)
os.makedirs(destination, exist_ok=True)
os.symlink(location, destination)


Expand Down
12 changes: 9 additions & 3 deletions man/operations/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,22 @@ def install_library(self, lib):
cmd_lib.append(library)

log.log_trace(f"Installing {library} for {self.aspect_name.title()}.")
log_level = int(self.args.log_level)
try:
log.log_trace(f"Installing {self.library_type} library '{library}' for {self.aspect_name.title()}.")
stdout = subprocess.PIPE if log_level > 2 or log_level == -1 else None
stderr = subprocess.PIPE if log_level > 2 or log_level == -1 else None
subprocess.run(
cmd_lib,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdout=stdout,
stderr=stderr,
check=True,
)
log.log_info(f"Installed {self.library_type} library '{library}' for {self.aspect_name.title()}.")
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
log.log_error(f"Error installing {self.library_type} library {library} for {self.aspect_name.title()}.")
if log_level <= 2 and log_level != -1:
log.log_debug(e.stderr.decode("utf-8"))



Expand Down

0 comments on commit 202b146

Please sign in to comment.