Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Remove no-longer-included files #5

@aappling-usgs

Description

@aappling-usgs

sb_replace_files() doesn't delete omitted files, which means that if you change the file-posting command in remake.yml to omit a file that you've posted in the past, or if you rename a file, the old file/name won't be removed from ScienceBase. Could this slim-data-release repo provide file removal in such circumstances?

I discovered this by accident, when I pushed files from a new item-in-progress before repointing to a different SB item than what's provided by the template. The result at https://www.sciencebase.gov/catalog/item/5faaac68d34eb413d5df1f22 was that I overwrote fgdc_metadata.xml and added a new file, res_polygons.zip. I assume it's OK that I've corrupted the example data release...but I think we could see problems in real data releases using this template with old files never getting removed. Specifically, executing the code in my new repo didn't delete the old files spatial.zip and cars.csv, even though those were not included in my file list.

  log/sb_posted_files.csv:
    command: sb_replace_files(filename = target_name, 
      sb_id = I('5faaac68d34eb413d5df1f22'),
      "out_data/res_polygons.zip",
      "out_xml/fgdc_metadata.xml",
      sources = "src/sb_utils.R")

image

Metadata

Metadata

Assignees

No one assigned

    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