-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make the export functionality more easily runnable as a single command (
fixes #4)
- Loading branch information
1 parent
cf83dcb
commit 5d687c2
Showing
4 changed files
with
51 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env" | ||
], | ||
"plugins": [ | ||
"@babel/plugin-transform-runtime", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
npx babel-node src/cli/exportAndSave.js $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2019 Stanford University see LICENSE for license | ||
|
||
import sinopiaExporter from '../../package' | ||
import { downloadAllRdfForGroup } from '../getGroupRDF' | ||
|
||
|
||
const helpText = ` | ||
> ./bin/export 'ucdavis' | ||
and you should end up with something like: | ||
$ tree sinopia_export/ | ||
sinopia_export/ | ||
└── ucdavis_2019-07-26T01:41:00.002Z | ||
├── 0c9895ff-9470-4c70-bee4-b791ee179b34 | ||
└── complete.log | ||
each RDF resource will have its own file. complete.log will be written at the end of a successful run. | ||
` | ||
|
||
|
||
console.debug(`arguments: ${process.argv}`) | ||
console.info(`sinopia_exporter v${sinopiaExporter.version}`) | ||
|
||
|
||
const groupName = process.argv[2] | ||
if(groupName) { | ||
downloadAllRdfForGroup(groupName) | ||
} else { | ||
console.error(helpText) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters