source-line-processor
Version:
`source-line-processor script.js --dir $PWD/test --dry-run --pattern "*.js"`
13 lines (12 loc) • 335 B
text/typescript
import { exec } from 'child_process';
export default (location: string, pattern?: string): Promise<string[]> => new Promise((resolve, reject) => {
exec(`git ls-files ${pattern || ''}`, {
cwd: location,
}, (error, stdout) => {
if (error) {
reject(error);
} else {
resolve(stdout.split('\n'));
}
})
});