Skip to content

remove ".git" with endswidth check rather than rstrip

Ned Coltman requested to merge fix/installscript into master

What this MR does / why does DuMux need it:

The script cleans the URL provided to find the name of the module that it wants to clone. During the cleaning, the ".git" ending is removed using the string rstrip method.

Unfortunately, if the module ends with the characters g, i, t, or ., these are also removed. Here is an example:

url = ""
targetModule = url.rstrip(".git").split("/")[-1]

returns dune-somethin, where the actual target should be dune-something

Notes for the reviewer

url = ""
targetModule = url.split("/")[-1].replace(".git", "")

returns dune-something. I tested this briefly and it works for all cases I can think of.

I guess we don't have many dumux-appl modules that end in those characters, and the dumux-pub modules typically end in numbers or characters earlier in the alphabet.

Before you request a review from someone, make sure to revise the following points:

  • does the new code follow the style guide?
  • do the test pipelines pass? (see guide on how to run pipelines for a merge request)
  • is the code you changed and/or the new code you wrote covered in the test suite? (if not, extend the existing tests or write new ones)
Edited by Ned Coltman

Merge request reports