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

bug where --iterate causes --append to be duplicated for each iteration #299

Closed
jacobmealey opened this issue May 13, 2024 · 3 comments · Fixed by #300
Closed

bug where --iterate causes --append to be duplicated for each iteration #299

jacobmealey opened this issue May 13, 2024 · 3 comments · Fixed by #300
Assignees
Labels
bug Something isn't working

Comments

@jacobmealey
Copy link
Contributor

The appended items are re-appended every iteration of a --iterate. I found this bug when I was working on #263, but i did more testing on 0.12.

two examples:

$ trurl example.com --append "path=folder" --iterate "scheme=http ssh ftp"
http://example.com/folder
ssh://example.com/folder/folder
ftp://example.com/folder/folder/folder
$ trurl example.com --append "query=foo=bar" --iterate "scheme=http ssh ftp"
http://example.com/?foo=bar
ssh://example.com/?foo=bar&foo=bar
ftp://example.com/?foo=bar&foo=bar&foo=bar
@bagder
Copy link
Member

bagder commented May 13, 2024

@jacobmealey do you want to work on fixing this or do you want me to have a look?

@jacobmealey
Copy link
Contributor Author

jacobmealey commented May 13, 2024

I'm working on getting the JSON input ready for a PR within the next couple of days, I can take a look once the PR is up and waiting for feedback.

however, if you (or someone else) wants to get this fixed up ASAP then by all means go ahead.

@bagder
Copy link
Member

bagder commented May 14, 2024

I'll grab it

@bagder bagder self-assigned this May 14, 2024
bagder added a commit that referenced this issue May 14, 2024
Since it works with the same URL object, doing repeated appends will
keep appending every loop which is not intended.

Add test cases to verify.

Reported-by: Jacob Mealey
Fixes #299
@bagder bagder added the bug Something isn't working label May 14, 2024
@bagder bagder closed this as completed in d80d308 May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants