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

set_renv not handling my file path #59

Open
stephlocke opened this issue Dec 10, 2019 · 9 comments
Open

set_renv not handling my file path #59

stephlocke opened this issue Dec 10, 2019 · 9 comments
Labels

Comments

@stephlocke
Copy link
Collaborator

stephlocke commented Dec 10, 2019

The set_renv() function is returning weirdly for me. The below file path is the one generated in the token create function.

> set_renv("HUBSPOT_PAT" = "C:\\Users\\steph\\OneDrive\\Documents/.hubspot_token1.rds")
> Sys.getenv("HUBSPOT_PAT")
[1] "C:UsersstephOneDriveDocuments/.hubspot_token1.rds"
@maelle
Copy link
Contributor

maelle commented Dec 10, 2019

You mean when running hubspot_token_create()?

@stephlocke
Copy link
Collaborator Author

Yep

@maelle
Copy link
Contributor

maelle commented Dec 10, 2019

Did you run it with a token path argument or is this the default?

@maelle
Copy link
Contributor

maelle commented Dec 10, 2019

And if it was not the default how does the file path the default would return look like for you?

https://github.com/lockedata/hubspot/blob/0c831d66c11820ede65e798847481727e6fec21a/R/hubspot_oauth.R#L122

@stephlocke
Copy link
Collaborator Author

That was with the default - the string above was the output generated by uq_filename()

@maelle
Copy link
Contributor

maelle commented Dec 11, 2019

And does the string look weird in .Renviron already? Or only when retrieving it via Sys.getenv?

@maelle
Copy link
Contributor

maelle commented Dec 16, 2019

@stephlocke a few questions

  • does the string look weird in .Renviron already? Or only when retrieving it via Sys.getenv?

  • What is Sys.getenv("HOME") on your system? And file.path(Sys.getenv("HOME"))?

  • And normalizePath("~"))? file.path(normalizePath("~"))?

Thanks!

@maelle
Copy link
Contributor

maelle commented Jan 6, 2020

Besides, did you use rtweet stuff on your machine?

@maelle maelle pinned this issue Jan 14, 2020
@stephlocke
Copy link
Collaborator Author

The hubspot looks like HUBSPOT_PAT=C:\Users\steph\OneDrive\Documents/.hubspot_token1.rds whereas rtweet lookes like TWITTER_PAT=C:/Users/steph/OneDrive/Documents/.rtweet_token2.rds

Removing the HUBSPOT_PAT and reauthing with set_renv results in the same backslashes

> Sys.getenv("HOME")
[1] "C:\\Users\\steph\\OneDrive\\Documents"
> file.path(Sys.getenv("HOME"))
[1] "C:\\Users\\steph\\OneDrive\\Documents"
> file.path(normalizePath("~"))
[1] "C:\\Users\\steph\\OneDrive\\Documents"

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

No branches or pull requests

2 participants