primo-extract
Version:
Extract all sources and templates from a Primo environment
40 lines (33 loc) • 1.09 kB
JavaScript
/**
* Primo Extract
*
* Extract source code and templates from NUI
*
* KULeuven/LIBIS
* Mehmet Celik (c) 2018
*/
import {version} from '../package.json';
import minimist from 'minimist'
import extract from './primo'
;
function usage(){
console.log("usage: primoExtract --primo=https://your.primo.instance --outDir=/directory/to/exported/source --nde\n\n");
}
console.log(`\nPrimo Extract NUI source code.\nversion ${version}. Use version <0.14 for Primo Classic, Use version <0.19 for PrimoVE and >=0.19 for NDE.\n\tWhen code is the manual ...\n\nKULeuven/LIBIS (c)2026\n\n`);
var argv = minimist(process.argv.slice(2),{
string: 'primo',
boolean: ['help'],
alias: { h: 'help'}
});
if (argv.h || argv.help) {
usage();
process.exit(1);
}
if (Object.keys(argv).includes("primo")) {
let primoUri = argv.primo;
let outDir = Object.keys(argv).includes('outDir') ? argv.outDir : process.cwd()
let primoType = Object.keys(argv).includes('nde') ? 'nde' : 'discovery';
extract(primoUri, outDir, primoType);
} else {
usage();
}