jupyterlab / extension-template

A `copier` template for JupyterLab extensions
Creative Commons Zero v1.0 Universal
55 stars 19 forks source link

Duplicate slashes for URLs generated from the repository URL with a trailing slash #74

Closed joaopalmeiro closed 5 months ago

joaopalmeiro commented 5 months ago

Hi! 👋

Description

When generating a new extension, if the repository URL has a trailing slash (e.g., https://github.com/jupyterlab/extension-template/), the URL in the bugs.url field of the package.json file will be generated with two slashes (e.g., https://github.com/jupyterlab/extension-template//issues). Same for the repository.url field (e.g., https://github.com/jupyterlab/extension-template/.git) and the Github Actions Status badge in the README.md file (e.g., https://github.com/jupyterlab/extension-template//workflows/Build/badge.svg)

Some kind of normalization (in the copier.yml file or in the package.json template file) would be handy from my perspective. Please let me know if I can help in any way.

Reproduce

  1. Generate a new extension (using the pipx run --pip-args=jinja2-time==0.2.0 copier==9.2.0 copy --trust --vcs-ref v4.3.1 https://github.com/jupyterlab/extension-template demo command, for example).
  2. Fill in the Git remote repository URL field with a URL with a trailing slash: https://github.com/jupyterlab/extension-template/
  3. Check the bugs.url and repository.url fields of the generated package.json file, as well as the Github Actions Status badge URL at the top of the README.md file.

Expected behavior

URL repositories without duplicate slashes, whether the repository URL has a trailing slash.

Context

welcome[bot] commented 5 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

krassowski commented 5 months ago

Sounds reasonable, feel welcome to open a PR!