Skip to content

rappdirs 0.3.2: 'version' argument is now vectorized, e.g. in user_cache_dir() #32

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

Closed
HenrikBengtsson opened this issue Jan 27, 2021 · 1 comment

Comments

@HenrikBengtsson
Copy link

Posting in case others run into this and also to make sure this update was intended.

Previously, I've used:

> packageVersion("rappdirs")
[1] ‘0.3.1> 
> rappdirs::user_cache_dir("foo", version = c("a", "b"))
[1] "/home/hb/.cache/foo/a/b"

With the new rappdirs 0.3.2, I now get:

> packageVersion("rappdirs")
[1] ‘0.3.2> rappdirs::user_cache_dir("foo", version = c("a", "b"))
[1] "~/.cache/foo/a" "~/.cache/foo/b"

The reason appears to be that rappdirs:::file_path(x) is now vectorized;

> packageVersion("rappdirs")
[1] ‘0.3.2> rappdirs:::file_path(c("a", "b"))
[1] "a" "b"
> packageVersion("rappdirs")
[1] ‘0.3.1> rappdirs:::file_path(c("a", "b"))
[1] "a/b"

The solution/workaround for is:

> packageVersion("rappdirs")
[1] ‘0.3.2> rappdirs::user_cache_dir("foo", version = do.call(file.path, as.list(c("a", "b"))))
[1] "/home/hb/.cache/foo/a/b"
@hadley
Copy link
Member

hadley commented Jan 28, 2021

Ooops, I'll fix that ASAP.

@hadley hadley closed this as completed in 7934229 Jan 28, 2021
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