Skip to content

Commit

Permalink
Add -e/--expansion flag to install.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zarillion committed Jun 6, 2024
1 parent 74ed19f commit bcd9798
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,19 @@ def main():
action="store_true",
help="uninstall and exit",
)
parser.add_argument(
"-e",
"--expansion",
type=int,
default=0,
help="install single expansion"
)
args = parser.parse_args()

target: Path = args.target
clean: bool = args.clean
uninstall: bool = args.uninstall
expansion: int = args.expansion

if not target.exists():
print(f"Path does not exist: {target}", file=sys.stderr)
Expand All @@ -82,6 +90,10 @@ def main():
plugin_name = f"HandyNotes_{plugin.name[3:]}"
target_dir = target.joinpath(plugin_name)

# skip expansion if this is not the one we want
if expansion not in (0, int(plugin.name[:2])):
continue

# remove previous installs
if clean or uninstall:
if target_dir.exists():
Expand Down

0 comments on commit bcd9798

Please sign in to comment.