dropbox_funs: Functions for integrating with dropbox

find_dropbox_dirR Documentation

Functions for integrating with dropbox

Description

A set of functions for easy integration with dropbox. This envisages a sister directory in the users dropbox (defaulrs to "projects", with a subdir for each repository) where are all non-code files (data, output, papers, etc.) can be stored and easily accessed, yet keeping the github repository clean.

Usage

find_dropbox_dir(version = c("business", "personal"))

get_dropbox_repo_dir(
  repo_name = get_git_repo_name(),
  repos_subdir = "projects",
  dropbox_base_dir = find_dropbox_dir(),
  create_dir = FALSE
)

dropbox_path(
  ...,
  repos_subdir = "projects",
  repo_name = get_git_repo_name(),
  dropbox_base_dir = find_dropbox_dir(),
  create_dir = FALSE
)

Arguments

version

A string specifying the version of Dropbox to use, if 2 are found on the machine. Can be either "personal" or "business" (default).

repo_name

character. Name of the git repository. Defaults to the name of the current git repository found via searching the git.config of the current R project, via get_git_repo_name().

repos_subdir

character. Subdirectory within the Dropbox directory where each repository subdirectory is found. Defaults to "projects".

dropbox_base_dir

character. Path to the base Dropbox directory. Defaults to the Dropbox directory found via find_dropbox_dir().

create_dir

logical. Whether to create the directory if it does not exist. Defaults to FALSE.

Details

find_dropbox_dir()tries to find the users Dropbox directory by looking for the info.json file in the Dropbox directory of the users appdata.

get_dropbox_repo_dir() returns the path to the directory where the non-code files (data, output, papers, etc.) for a repository are stored in Dropbox.

dropbox_path() extends get_dropbox_repo_dir() by allowing additional path components to be joined to the end of the path with fs::path().

Value

A path string returned by fs::path() to the relevant directory/file.


WhiteJP/jpw documentation built on April 17, 2025, 5:47 a.m.