R/gsuite_db_auth.R

Defines functions gsuite_db_auth

gsuite_db_auth <- function() {
  
  #-- Load Packages
  library(googledrive)
  library(googlesheets4)
  
  #-- Service Account
  google_json_file <- '/dbfs/FileStore/01-Credentials/Google_Service_Account.json'
  google_service_account <- readChar(google_json_file, nchars = file.info(google_json_file)$size) %>% 
    gsub(pattern = '\\n', replacement = '\\\\n')
  
  #-- Authenticate
  drive_auth(path = google_service_account)
  gs4_auth(path = google_service_account)
  
}
Ehsan-F/R-Mixtape documentation built on June 24, 2020, 12:22 a.m.