diff --git a/src/install.py b/src/install.py index aadcf01..69668d1 100644 --- a/src/install.py +++ b/src/install.py @@ -12,19 +12,7 @@ from util import check_ground_libs_path, check_sudo console = Console() -def install(args): - - check_sudo() - check_ground_libs_path() - - # figure out which version to install - package_name = args.name - version = "latest" - if "@" in args.name: - split = package_name.split("@") - package_name = split[0] - version = split[1] - +def install_package(package_name, version, args): retries_left = args.max_retries with console.status("Downloading tarball...", spinner="bouncingBall", spinner_style="blue") as status: @@ -82,4 +70,20 @@ def install(args): if not os.path.isfile(symlink_path): os.symlink(os.path.join(extract_dir, package_name, "main.so"), symlink_path) - console.print("[:white_check_mark:] Done!") \ No newline at end of file + console.print("[:white_check_mark:] Done!") + +def install(args): + + check_sudo() + check_ground_libs_path() + + for package in args.names: + # figure out which version to install + package_name = package + version = "latest" + if "@" in package: + split = package.split("@") + package_name = split[0] + version = split[1] + + install_package(package_name, version, args) \ No newline at end of file diff --git a/src/main.py b/src/main.py index 81f9c1c..6e2a4ad 100644 --- a/src/main.py +++ b/src/main.py @@ -15,7 +15,7 @@ def parse_arguments(): # install command install_command = sub_parsers.add_parser(name="install", description="install a mineral") - install_command.add_argument("name", help="name of the mineral to install") + install_command.add_argument("names", help="name of the minerals to install", nargs="+") install_command.add_argument("--max-retries", help="max number of download retries before giving up", default=3, type=int) # uninstall command