UNPKG

piral-cli

Version:

The standard CLI for creating and building a Piral instance or a Pilet.

18 lines (15 loc) 462 B
import * as api from './api'; import { log } from './common'; import { CliPlugin } from './types'; export function inject(pluginPath: string) { try { const plugin: CliPlugin = require(pluginPath); if (typeof plugin === 'function') { plugin(api); } else { log('generalDebug_0003', `Skipping plugin from "${pluginPath}". Did not export a function.`); } } catch (ex) { log('pluginCouldNotBeLoaded_0205', pluginPath, ex); } }