diff --git a/src/exposed/index.ts b/src/exposed/index.ts index 8dab522..22419d3 100644 --- a/src/exposed/index.ts +++ b/src/exposed/index.ts @@ -1,3 +1,4 @@ export { default as options } from './options'; export { default as series } from './series'; +export { default as silent } from './silent'; export { default as line } from './line'; diff --git a/src/exposed/silent.ts b/src/exposed/silent.ts new file mode 100644 index 0000000..c3cce1e --- /dev/null +++ b/src/exposed/silent.ts @@ -0,0 +1,14 @@ +import { TScript } from '~/types'; +import core from '~/core'; +import logger from '~/utils/logger'; + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default function silent(script: TScript) { + return async function silent(args?: string[]): Promise { + try { + await core.run(script, args || []); + } catch (err) { + logger.error(err); + } + }; +}