Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handler: async argv => {
const { commitTo, commitMessage, sourceType, source, append } = argv;
const repo = await Repo.getFromEnvironment();
const tree = repo.createTree();
if (append) {
// TODO: load an existing tree instead
throw new Error('append is not yet implemented');
}
let outputHash;
try {
outputHash = await importTaxonomy(tree, argv);
console.error('tree ready');
} catch (err) {
console.error('failed to import taxonomy:', err);
process.exit(1);
}