Skip to content

Setting project metadata doesn't work if no metadata is specified at project creation. #48

@Andrew0Hill

Description

@Andrew0Hill

When creating a project with no metadata, attempts to set metadata via the set_* calls will fail since the metadata file is not created.

Image

Steps to replicate:

  1. Create default project using CIDAtools::create_project() but do not specify any metadata field (analyst, pi, etc).
  2. Run CIDAtools::set_project_analyst("foo")

This occurs because create_project only builds a metadata file if the metadata is specified:

# has meta been provided?
meta <- !all(c(ProjectName, PI, analyst, datalocation) %in% "")

if(meta){
dir.create(paste0(path, '/.ProjData'))
ProjData <- list(ProjectName = ProjectName, PI = PI,
analyst = analyst, datalocation = datalocation,
gitlocation = gitlocation)
write.dcf(ProjData, file.path(path, '/.ProjData/Data.dcf'))
}

We need to either always create the metadata file or have calls to set_* call a function to first create the metadata file instead.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions