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

Repo build script broken for repos with certain characters in the path #136

Open
stephenjust opened this issue Nov 8, 2021 · 2 comments

Comments

@stephenjust
Copy link

repo_path = configured_remote_origin.strip().rstrip(".git").lstrip('[email protected]:').lstrip('https://github.com/s')

In Python, lstrip and rstrip do not trim instances of a string, they strip characters from the provided from input. As an example, https://github.com/stephenjust/unmanic-plugins.git gets trimmed to ephenjust/unmanic-plugins (where the "st" gets chopped off because "https://github.com/" contains "s" and "t".

You probably want "removeprefix" and "removesuffix" as the most concise solution, but that requires upgrading to Python 3.9 for your Action. (This is pretty easy, but I'm not sure if you'd want inconsistency between the unmanic container running py3.8 and this build tooling running py3.9.)

@Josh5
Copy link
Contributor

Josh5 commented Nov 9, 2021

I'm on the fence. On the one hand, a lot of lts distros still use python 3.6/8. On the other hand who cares, i use python 3.10.

Was this not just a typo with the lstrip '.com/s'?
I can't understand why the s is there. Pretty sure that is a mistake.

At any rate, I think I'll probably merge in your fix. Thanks for the contribution!

@stephenjust
Copy link
Author

Removing the s alone had no impact, since there was already an s in the string from https://

In terms of python, it does look like the Ubuntu LTS does have packages for newer versions (python3.9, etc), they're just not included automatically by python3.

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

No branches or pull requests

2 participants