Skip to content

Commit

Permalink
fix: actually disable json flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 23, 2021
1 parent e5e65e0 commit f45e2f8
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ lib
node_modules
.DS_Store
.idea
oclif.manifest.json
1 change: 0 additions & 1 deletion bin/dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node

const oclif = require('@oclif/core');
oclif.settings.disableJsonFlag = true;

const path = require('path');
const project = path.join(__dirname, '..', 'tsconfig.json');
Expand Down
5 changes: 1 addition & 4 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env node

const oclif = require('@oclif/core');
oclif.settings.disableJsonFlag = true;

oclif.run()
require('@oclif/core').run()
.then(require('@oclif/core/flush'))
.catch(require('@oclif/core/handle'))
10 changes: 6 additions & 4 deletions src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ function parseOrgAndRepo(entity: string): { org: string; repo: string | null } {
}
}

export class Add extends Command {
public static readonly description = 'Add a github org. Requires GH_TOKEN to be set in the environment.';
public static readonly flags = {
export default class Add extends Command {
public static description = 'Add a github org. Requires GH_TOKEN to be set in the environment.';
public static disableJsonFlag = true;

public static flags = {
method: Flags.string({
description: 'Method to use for cloning.',
default: 'ssh',
options: ['ssh', 'https'],
}),
};

public static readonly args = [
public static args = [
{
name: 'entity',
description: 'Github org, repo, or url to add',
Expand Down
9 changes: 5 additions & 4 deletions src/commands/cd.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Command } from '@oclif/core';

export class Cd extends Command {
public static readonly description = 'cd into a github repository.';
public static readonly flags = {};
public static readonly args = [
export default class Cd extends Command {
public static description = 'cd into a github repository.';
public static disableJsonFlag = true;
public static flags = {};
public static args = [
{
name: 'repo',
description: 'Name of repository.',
Expand Down
9 changes: 5 additions & 4 deletions src/commands/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { cli } from 'cli-ux';
import { groupBy, sortBy } from 'lodash';
import { Repos, Repository } from '../repos';

export class List extends Command {
public static readonly description = 'List all added repositories.';
public static readonly flags = {};
public static readonly aliases = ['ls'];
export default class List extends Command {
public static description = 'List all added repositories.';
public static disableJsonFlag = true;
public static flags = {};
public static aliases = ['ls'];

public async run(): Promise<void> {
const repositories = (await Repos.create()).getContents();
Expand Down
9 changes: 5 additions & 4 deletions src/commands/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { Command } from '@oclif/core';
import * as open from 'open';
import { Repos } from '../repos';

export class Open extends Command {
public static readonly description = 'Open a github repository.';
public static readonly flags = {};
public static readonly args = [
export default class Open extends Command {
public static description = 'Open a github repository.';
public static disableJsonFlag = true;
public static flags = {};
public static args = [
{
name: 'repo',
description: 'Name of repository.',
Expand Down
7 changes: 4 additions & 3 deletions src/commands/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { Config } from '../config';
import { AutoComplete } from '../autocomplete';
import { MpmCd } from '../mpmCd';

export class Setup extends Command {
public static readonly description = 'Setup mpm';
public static readonly flags = {
export default class Setup extends Command {
public static description = 'Setup mpm';
public static disableJsonFlag = true;
public static flags = {
directory: Flags.string({
description: 'Location to setup repositories.',
char: 'd',
Expand Down
9 changes: 5 additions & 4 deletions src/commands/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { cli } from 'cli-ux';
import { Command } from '@oclif/core';
import { Repos } from '../repos';

export class View extends Command {
public static readonly description = 'View a github repository.';
public static readonly flags = {};
public static readonly args = [
export default class View extends Command {
public static description = 'View a github repository.';
public static disableJsonFlag = true;
public static flags = {};
public static args = [
{
name: 'repo',
description: 'Name of repository.',
Expand Down
7 changes: 4 additions & 3 deletions src/commands/where.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Command, Flags } from '@oclif/core';
import { Repos } from '../repos';

export class View extends Command {
public static readonly description = 'Print location of a github repository.';
public static readonly flags = {
export default class View extends Command {
public static description = 'Print location of a github repository.';
public static disableJsonFlag = true;
public static flags = {
remote: Flags.boolean({
description: 'Return url of repository',
default: false,
Expand Down

0 comments on commit f45e2f8

Please sign in to comment.