import * as yargs from 'yargs'; import { Auth, Remote } from '../app/auth'; import { inspect } from '@radic/util'; import { Cli } from '../app/cli'; export var command: string = 'repo [remote]'; export var describe: string = 'git repo commands'; export function builder( args: yargs.Argv ) { args.options({ l: { alias: 'list' }, a: { alias: 'auth' } }) } var opts = { list: false, listTeam: false, showBranches: false, showTags: false, auths: [], //default } export function handler( argv ) { if (Cli.handleGlobals(argv)) return; inspect(argv); Auth.getDefault(Remote.bitbucket_server); // Auth.get('gh').getConnection().patch('repos/sebwite/cli', {description: 'Addon Test'}); // Auth.get('bb').getConnection().put('repositories/sebwitepackages/sebwite-cli', {description: 'Addon Test'}); // Auth.get('bbs').getConnection().put('repositories/sebwitepackages/sebwite-cli', {description: 'Addon Test'}); //Auth.get('sebjenks').getConnection().get('jobs'); var con = Auth.get('bb').getConnection(); // con.get('teams', { role : 'member' }).then(console.log.bind(console)); return; // // var remote = Remote[argv.remote]; // Auth.filter({ remote : remote.toString() }).forEach(( auth: Auth ) => // { // // var c = remote.connectionClass; // var i = remote.getConnection(auth); // var g = i.get('teams', {role: 'admin'}).then(console.log.bind(console)).catch(console.error.bind(console)); // dump('remote', remote, 'auth', auth); // // // }) //Remote.all().forEach(( remote: Remote ) => ) }