Skip to content

Commit

Permalink
Return env variable value as Path
Browse files Browse the repository at this point in the history
  • Loading branch information
superrnovae committed Aug 31, 2022
1 parent 5c404d9 commit 0444f04
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,3 @@ COPY --from=git /version /app/.version
ENV IS_DOCKER_CONTAINER Yes

CMD [ "/app/docker/entrypoint.sh" ]




5 changes: 3 additions & 2 deletions permasigner/dpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ def __init__(self, src: Path, dest: Path, debug: bool) -> None:

def extract_with_dpkg(self) -> None:
# Extract deb contents with dpkg-deb -X
logger.log("Extracting deb file...\n", color=colors["yellow"])
logger.log("Extracting deb file...", color=colors["yellow"])
logger.debug(f"Running command: dpkg-deb -X {self.src} {self.dest}", self.debug)
subprocess.run(["dpkg-deb", "-X", self.src, self.dest], stdout=subprocess.DEVNULL)

def extract_with_ar(self) -> None:
logger.log("Extracting deb file...\n", color=colors["yellow"])
""" Opens deb archive and extracts content of data.tar.* """
logger.log("Extracting deb file...", color=colors["yellow"])
logger.debug(f"Extracting {self.src} with unix-ar", self.debug)

with unix_ar.open(self.src) as ar_file:
Expand Down
2 changes: 1 addition & 1 deletion permasigner/permasigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(self) -> None:
# Check for dependencies
logger.log("Checking for dependencies...", color=colors["yellow"])
self.ldid = utils.cmd_in_path('ldid')
if self.ldid:
if self.ldid is not None:
logger.debug("ldid found!", self.args.debug)
else:
logger.debug("ldid not found in PATH, we will download it later if needed", self.args.debug)
Expand Down
2 changes: 1 addition & 1 deletion permasigner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_data_directory() -> Path:
""" Get path to data directory"""

# Get the value of PERMASIGNER_HOME variable and if it's exported use it as data directory
ps_home = os.environ.get("PERMASIGNER_HOME")
ps_home = Path(os.environ.get("PERMASIGNER_HOME"))
if ps_home:
return ps_home

Expand Down

0 comments on commit 0444f04

Please sign in to comment.