8000 Handle trailing slash on url. fix #546. by ramiroluz · Pull Request #573 · cookiecutter/cookiecutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle trailing slash on url. fix #546. #573

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

Merged
merged 3 commits into from
Nov 5, 2015

Conversation

ramiroluz
Copy link
Contributor

Quick fix to handle an extra trailing slash on the template url.

Fix issue #546.

@codecov-io
Copy link

Current coverage is 99.18%

Merging #573 into master will not affect coverage as of 1a748ed

@@            master    #573   diff @@
======================================
  Files           12      12       
  Stmts          489     490     +1
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit            485     486     +1
  Partial          0       0       
  Missed           4       4       

Review entire Coverage Diff as of 1a748ed


Uncovered Suggestions

  1. +0.41% via ...okiecutter/config.py#19...20
  2. +0.41% via ...ookiecutter/utils.py#27...28

Powered by Codecov. Updated on successful CI builds.

@@ -103,6 +103,8 @@ def clone(repo_url, checkout=None, clone_to_dir=".", no_input=False):
msg = "'{0}' is not installed.".format(repo_type)
raise VCSNotInstalled(msg)

if repo_url.endswith('/'):
repo_url = repo_url[:-1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we can also use repo_url.strip('/').

However I am not sure if this is valid for all of the possible repo urls.. 😟

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are any repo_url starting with a slash? Like: repo_url = '/home/eliasdorneles/cookiecutter-pypackage/'

If so, it would be better to use rstrip(). I will try it and run the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, rstrip passed all tests.

@hackebrot hackebrot added the bug This issue/PR relates to a bug. label Oct 31, 2015
8000 pydanny added a commit that referenced this pull request Nov 5, 2015
Handle trailing slash on url. fix #546.
@pydanny pydanny merged commit 10ad1bd into cookiecutter:master Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0