@orvium/orvium-tools
Version:
Set of tools to interact with Orvium API
26 lines (25 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const export_deposit_1 = require("./export-deposit"); // Import the core function from the programmatic entry point
const depositId = process.argv[2];
// Check is provided, otherwise exit
if (!depositId) {
console.error('Please use: npx ts-node import.ts <depositId> <donwloadDirectory>');
process.exit(1);
}
// Obtain filepath to JSON metadata folder in the command line
const downloadPath = process.argv[3];
// Check is provided, otherwise exit
if (!downloadPath) {
console.error('Please use: npx ts-node import.ts <depositId> <donwloadDirectory>');
process.exit(1);
}
// Validate arguments
if (!depositId || !downloadPath) {
console.error('Usage: deposit-importer <directory> <community>');
process.exit(1);
}
// Execute the export process using the provided arguments
(0, export_deposit_1.exportDeposit)(depositId, downloadPath)
.catch(err => console.error('Error during deposit export:', err));