Skip to contents

envvar_get_uuid() gets a UUID from an environment variable

Usage

envvar_get_uuid(x, default = NULL, validate = NULL, warn_default = TRUE)

Arguments

x

String containing an environment variable name

default

Optional default value if the environment variable is not set

validate

Optional function that checks a value for validity

warn_default

Show a warning if the default value is used (default: TRUE)

Value

An object of the class "UUID" representing a vector of UUIDs.

Examples


# Get a file path and make sure it exists
envvar_set("DEMO_GUID" = "d647f20f-c44c-4914-8255-9eca97150d4c")
envvar_get_uuid("DEMO_GUID")
#> UUID: d647f20f-c44c-4914-8255-9eca97150d4c