Files
stats/packages/cli/src/importer/index.ts
Carl-Gerhard Lindesvärd 1b613538cc first working cli importer
2024-07-21 23:55:04 +02:00

26 lines
425 B
TypeScript

import path from 'path';
import arg from 'arg';
import { importFiles } from './importer';
export default function importer() {
const args = arg(
{
'--glob': String,
},
{
permissive: true,
}
);
if (!args['--glob']) {
throw new Error('Missing --glob argument');
}
const cwd = process.cwd();
const filePath = path.resolve(cwd, args['--glob']);
return importFiles(filePath);
}