Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

r - Getting credentials::set_github_pat() to Work in .Rprofile

I've setup access to the Github API using a personal access token (PAT) using the credentials package. This works if I run credentials::set_github_pat() manually in the console whenever I start a new session. However, I'd like to include this in my .Rprofile so I don't have to do this everytime.

However, this doesn't work for me. Here is the contents of my .Rprofile

cat("Loading custom .Rprofile")

# Load Github API PAT
credentials::set_github_pat(force_new = T, validate = T, verbose = T)

I know .Rprofile is being loaded when starting a new session since cat("Loading custom .Rprofile") works. But I'm not prompted for my PAT on startup. I still have to run credentials::set_github_pat() in the console.

Various guides suggest including credentials::set_github_pat() in .Rprofile, including the credentials vignette.

I'm using RStudio Server v1.1.463, R v3.6.2, and git v2.7.4 on ubuntu 16.04. Credential helper is cache.

I haven't had any luck finding guidance via search to get this to work. Any ideas on what I'm missing here?

question from:https://stackoverflow.com/questions/65617442/getting-credentialsset-github-pat-to-work-in-rprofile

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...