Reindex a version of an asset of a project from the registry.
This regenerates all of the internal ..manifest
and ..links
files.
reindexVersion(project, asset, version, staging, url)
NULL
is invisibly returned if the version was successfully reindexed.
info <- startGobbler()
removeProject("test", info$staging, url=info$url) # start with a clean slate.
createProject("test", info$staging, url=info$url)
# Mocking up a version if it doesn't already exist.
src <- allocateUploadDirectory(info$staging)
write(file=file.path(src, "foo"), "BAR")
uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)
fetchManifest("test", "simple", "v1", registry=info$registry, url=info$url)
#> $foo
#> $foo$size
#> [1] 4
#>
#> $foo$md5sum
#> [1] "f98bf6f12e995a053b7647b10d937912"
#>
#>
# Let's add a new file directly to the directory.
write(file=file.path(info$registry, "test", "simple", "v1", "whee"), "stuff")
# And reindexing the version.
reindexVersion("test", "simple", "v1", staging=info$staging, url=info$url)
fetchManifest("test", "simple", "v1", registry=info$registry, url=info$url)
#> $foo
#> $foo$size
#> [1] 4
#>
#> $foo$md5sum
#> [1] "f98bf6f12e995a053b7647b10d937912"
#>
#>
#> $whee
#> $whee$size
#> [1] 6
#>
#> $whee$md5sum
#> [1] "9eb84090956c484e32cb6c08455a667b"
#>
#>