Skip to content
Snippets Groups Projects
Commit 6038cf81 authored by Ronald Jäpel's avatar Ronald Jäpel
Browse files

fix incorrect repo types in cli_integration.py

parent 7857538e
No related branches found
No related tags found
No related merge requests found
...@@ -67,8 +67,8 @@ _results_ repo. ...@@ -67,8 +67,8 @@ _results_ repo.
Once created, the remotes need to be added to the local repositories. Once created, the remotes need to be added to the local repositories.
```bash ```bash
cadet-rdm add-remote-to-repo <path_to_repo> git@<my_git_server.foo>:<project>.git cadet-rdm add-remote-to-repo git@<my_git_server.foo>:<project>.git
cadet-rdm add-remote-to-repo <path_to_repo/output_folder> git@<my_git_server.foo>:<project>_output.git cadet-rdm --path_to_repo output add-remote-to-repo git@<my_git_server.foo>:<project>_output.git
``` ```
or in Python: or in Python:
...@@ -125,7 +125,7 @@ cadet-rdm run-command "python example_file.py" "commit message for the results" ...@@ -125,7 +125,7 @@ cadet-rdm run-command "python example_file.py" "commit message for the results"
``` ```
#### Using results from another repository ### Using results from another repository
You can load in results from another repository to use in your project using the CLI: You can load in results from another repository to use in your project using the CLI:
......
...@@ -3,7 +3,7 @@ import subprocess ...@@ -3,7 +3,7 @@ import subprocess
import click import click
from .repositories import ProjectRepo from .repositories import ProjectRepo, BaseRepo
from .initialize_repo import initialize_repo as initialize_git_repo_implementation, init_lfs from .initialize_repo import initialize_repo as initialize_git_repo_implementation, init_lfs
from .initialize_repo import initialize_from_remote as initialize_from_remote_implementation from .initialize_repo import initialize_from_remote as initialize_from_remote_implementation
from .conda_env_utils import prepare_conda_env as prepare_conda_env_implementation from .conda_env_utils import prepare_conda_env as prepare_conda_env_implementation
...@@ -89,9 +89,11 @@ def initialize_repo(path_to_repo: str, output_repo_name: (str | bool) = "output" ...@@ -89,9 +89,11 @@ def initialize_repo(path_to_repo: str, output_repo_name: (str | bool) = "output"
@cli.command() @cli.command()
@click.option("-p", '--path_to_repo', default=".",
help='Path to repository to which the remote is added. Default is cwd.')
@click.argument('remote_url') @click.argument('remote_url')
def add_remote_to_repo(remote_url: str, ): def add_remote_to_repo(remote_url: str, path_to_repo="."):
repo = ProjectRepo(".") repo = BaseRepo(path_to_repo)
repo.add_remote(remote_url) repo.add_remote(remote_url)
print("Done.") print("Done.")
...@@ -100,7 +102,7 @@ def add_remote_to_repo(remote_url: str, ): ...@@ -100,7 +102,7 @@ def add_remote_to_repo(remote_url: str, ):
@click.argument('file_type') @click.argument('file_type')
def add_file_type_to_lfs(file_type: str, ): def add_file_type_to_lfs(file_type: str, ):
init_lfs(lfs_filetypes=[file_type], path=".") init_lfs(lfs_filetypes=[file_type], path=".")
repo = ProjectRepo(".") repo = BaseRepo(".")
repo.add_all_files() repo.add_all_files()
repo.commit(f"Add {file_type} to lfs") repo.commit(f"Add {file_type} to lfs")
...@@ -114,5 +116,6 @@ def prepare_conda_env(url): ...@@ -114,5 +116,6 @@ def prepare_conda_env(url):
@cli.command() @cli.command()
def print_output_log(): def print_output_log():
# ToDo: test if Project or Output repo
repo = ProjectRepo(".") repo = ProjectRepo(".")
repo.print_output_log() repo.print_output_log()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment