UNPKG

savory

Version:

A command-line interface for operating your Codefresh account

24 lines (22 loc) 817 B
const fp = require('lodash/fp'), { middleware: apiClientMiddleware } = require('../../lib/api_client'), opn = require('opn'); module.exports = { command: "browse", description: "Browse to Codefresh's website", builder: (yargs)=> yargs .command( 'build <build-id>', 'View specific build id', (yargs)=> { return yargs.positional('build-id', { description: "The id of the build" }); }, fp.pipe(apiClientMiddleware, ({ _httpClient, buildId })=>{ _httpClient(`builds/${buildId}`) .then(({ serviceName })=> opn(`https://g.codefresh.io/pipelines/${serviceName}/builds/${buildId}`)) .catch(console.warn); })) };