Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class CollectionObject {
const rocrateOpts = {alwaysAsArray: true, resolveLinks: true};
if (crateDir) {
// Load the RO-Crate from the specified directory
console.log("CRATE DIR", crateDir)
const metaPath = path.join(crateDir, "ro-crate-metadata.json");
const json = JSON.parse(fs.readFileSync(metaPath));
this.crate = new ROCrate(json, rocrateOpts);
Expand Down Expand Up @@ -166,6 +165,7 @@ function getOpts(extaOpts) {
.option('-d --data-dir <dirs>', "Directory of data files with sub directories '/Sound files' (for .wav) and '/Transcripts' (.csv)")
.option('-D --debug <ns>', 'Use this in your collector to turn off some behaviour for debugging')
.option('-m --multiple', 'Output multiple Objects rather than a single object')
.option('-O --object-dir <ns>', 'Name for the folder containing object metadata, default "__object__"')

program.parse(process.argv);
return program.opts();
Expand All @@ -188,6 +188,7 @@ class Collector {
this.repoPath = this.opts.repoPath || "../repo";
this.repoScratch = this.opts.repoScratch || "../scratch";
this.repoName = this.opts.repoName || "repository";
this.objectDirName = this.opts.objectDir || "__object__";
this.debug = this.opts.debug;
if (this.debug == "true") { // Force type coercion
this.debug = true;
Expand All @@ -206,7 +207,8 @@ class Collector {

async connect() {
this.repo = ocfl.storage({root: this.repoPath, layout: {
extensionName: '000N-path-direct-storage-layout'
extensionName: '000N-path-direct-storage-layout',
suffix: `/${this.objectDirName}`,
}});

if (!await fs.pathExists(this.repoPath)) {
Expand Down