dw-0 / kiauh

Klipper Installation And Update Helper
GNU General Public License v3.0
3.3k stars 474 forks source link

do not mess with klipper url, allow access via ssh or sites like gitlab, alternate to #452 #465

Closed hg42 closed 4 months ago

hg42 commented 4 months ago

like #452, which says "This addresses #398 as well as including the functionality from the open PR #323 regarding ssh cloning (since, they both touch the same line of code, in effectively the same way)"

the git url for klipper can be on other schemes like ssh:// or https://gitlab.

Additionally, if there is a need to use http:// e.g. because of firewall rules etc. then the current code would not allow this, because it removes the http://github.com/ and adds https://github.com/.

Actually, I would just remove the code that messes with the url.

I only inserted the addition of https://github.com/ for compatibility in case the configuration does not contain a full url.

Not sure why the .git was removed but not added afterwards. The official github clone url would have a .git at the end. Also, in clone_klipper the sed command uses the i-flag, but not in switch_clipper_repo_menu.

Not messing with the url would remove the duplicate code of the same thing. Alternatively, the url could be normalized in a central function, e.g. normalize_git_url.

hg42 commented 4 months ago

ok, I see the rewrite in python... :-)