diff --git a/dist/fcs.py b/dist/fcs.py index 0d4ac60..fc0df76 100644 --- a/dist/fcs.py +++ b/dist/fcs.py @@ -176,6 +176,9 @@ def run_sync_files(self): if hasattr(self.args, "gx_db"): sync_files_args += [self.mount_arg, str(self.args.gx_db) + ":" + str(DEFAULT_CONTAINER_DB)] + if hasattr(self.args, "mft_dir"): + sync_files_args += [self.mount_arg, str(self.args.mft_dir) + ":" + "/mft-volume/"] + sync_files_args += [ self.args.docker_image, "python3", @@ -291,10 +294,15 @@ def modify_db_arguments(self): argument, pos = find_argument(cmd, "--mft") if argument is None and "--help" not in cmd: print("Error: database source is required") - print('Please specify "--mft=url/to/db"') + print('Please specify "--mft=url/or/path/to/db"') print("Please see https://github.com/ncbi/fcs/wiki/") self.parser.print_usage() sys.exit() + elif argument is not None and Path(argument).exists(): + self.args.mft_dir = Path(os.path.abspath(os.path.dirname(argument))) + mft_name = os.path.basename(argument) + replacement = str(Path("/mft-volume/") / mft_name) + cmd = cmd[:pos] + cmd[pos:].replace(argument, replacement, 1) self.joined_extra_args = cmd