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

Retain names of versions when subsetting #1806

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

DavisVaughan
Copy link
Member

Currently with dev usethis I see this with use_version() with no arguments

> usethis::use_version()
Current version is 0.5.2.9000.
What should the new version be? (0 to exit) 

1: major --> 1.0.0
2: minor --> 0.6.0
3: patch --> 0.5.3
4:   dev --> 0.5.2.9001

Selection: 2Setting Version field in DESCRIPTION to '0.6.0'
Error in if (names(new_ver) == "dev") { : argument is of length zero

This is due to this change in choose_version() #1784

Particularly, this line, which now uses [[ to subset versions (which is reasonable because there is only 1 choice).

versions[[choice]]

It is problematic here because [[ drops the names of versions, and we actually need the name to be returned for use in use_version()

@DavisVaughan
Copy link
Member Author

Failing until #1807 is merged

@DavisVaughan DavisVaughan requested a review from jennybc March 15, 2023 15:52
@jennybc
Copy link
Member

jennybc commented Apr 19, 2023

Thanks!

@jennybc jennybc merged commit 9511265 into r-lib:main Apr 19, 2023
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

Successfully merging this pull request may close these issues.

2 participants