Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not pass target dir without also passing branch name #187

Closed
yuvipanda opened this issue Jun 24, 2021 · 2 comments · May be fixed by #192
Closed

Can not pass target dir without also passing branch name #187

yuvipanda opened this issue Jun 24, 2021 · 2 comments · May be fixed by #192
Labels

Comments

@yuvipanda
Copy link
Contributor

yuvipanda commented Jun 24, 2021

Bug description

#185 adds autodetecting branch name on omission. But now we have two consecutive optional args on the commandline - branch and repo_dir (target clone path). So if we want to pass just the repo url and repo_dir, it's currently not possible.

Expected behaviour

Tell nbgitpuller to autodetect branch name but specify target directory when called from the commandline

Actual behaviour

If only two arguments are specified on the commandline, they are counted as repo url and branch, not repo url and repo_dir

How to reproduce

❯ gitpuller https://github.com/jupyterhub/jupyterhub target-dir                                           2 ↵
Traceback (most recent call last):
  File "/Users/yuvipanda/.local/share/virtualenvs/nbgitpuller/bin/gitpuller", line 33, in <module>
    sys.exit(load_entry_point('nbgitpuller', 'console_scripts', 'gitpuller')())
  File "/Users/yuvipanda/code/nbgitpuller/nbgitpuller/pull.py", line 310, in main
    for line in GitPuller(
  File "/Users/yuvipanda/code/nbgitpuller/nbgitpuller/pull.py", line 78, in __init__
    raise ValueError(f"Branch: {self.branch_name} -- not found in repo: {self.git_url}")
ValueError: Branch: target-dir -- not found in repo: https://github.com/jupyterhub/jupyterhub
@sean-morris
Copy link
Contributor

I will make the command line arguments keyword instead of positional. The argparser can handle it. Should have looked that up! when i ran into the problem.

@yuvipanda
Copy link
Contributor Author

I think this was merged in #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants