From 82d6e7d7c7b28f11298e2125ef16fbcfa0904825 Mon Sep 17 00:00:00 2001 From: "Stefano C. Coronado" Date: Wed, 1 Jan 2020 23:05:05 -0500 Subject: [PATCH] resolved conditional suggestion and fixed arg help --- pkg-install | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pkg-install b/pkg-install index ea94205..e609fd8 100755 --- a/pkg-install +++ b/pkg-install @@ -9,7 +9,7 @@ import subprocess parser = ArgumentParser(description="Install AUR packages into a Docker container") parser.add_argument("package_name", type=str, help="name of the AUR package") parser.add_argument("-x", type=str, metavar='EXECUTABLE', help="name of executable") -parser.add_argument("-e", type=str, help="edit generic dockerfile") +parser.add_argument("-e", type=str, help="add extra step in dockerfile") args = vars(parser.parse_args()) package_name = args['package_name'] @@ -42,13 +42,8 @@ RUN git clone https://aur.archlinux.org/yay.git WORKDIR /home/{user}/yay RUN makepkg -si --noconfirm -""" -if edit_flag is not None: #if -e flag is passed then take on the following string - extra_run = f"""RUN {edit_flag}""" -else: - extra_run = "" - -dockerfile += extra_run + f""" +#add extra step +{"RUN " + edit_flag if edit_flag is None else ""} # Now you can play with whatever package you'd like RUN yay -S --noconfirm {package_name}