import shelljs from 'shelljs' ; import { assertExists , assertIsNonEmptyString } from '.' ; export type ListKeyfiles = ( ) => string [ ] ; export default function provideListKeyfiles ( shell , fortaKeystore , configFilename ) { assertExists ( shell , 'shell' ) ; assertIsNonEmptyString ( fortaKeystore , 'fortaKeystore' ) ; assertIsNonEmptyString ( configFilename , 'configFilename' ) ; return function listKeyfiles ( ) { return shell . ls ( fortaKeystore ) . filter ( filename => filename !== configFilename ) ; } ; }