From f45e2f805be92357b13b901d44f61f65a83fee03 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 23 Aug 2021 11:34:41 -0600 Subject: [PATCH] fix: actually disable json flag --- .gitignore | 1 + bin/dev | 1 - bin/run | 5 +---- src/commands/add.ts | 10 ++++++---- src/commands/cd.ts | 9 +++++---- src/commands/list.ts | 9 +++++---- src/commands/open.ts | 9 +++++---- src/commands/setup.ts | 7 ++++--- src/commands/view.ts | 9 +++++---- src/commands/where.ts | 7 ++++--- 10 files changed, 36 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 0263d8e1..61b5ab06 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ lib node_modules .DS_Store .idea +oclif.manifest.json diff --git a/bin/dev b/bin/dev index 70b7bd4b..50aad4f3 100755 --- a/bin/dev +++ b/bin/dev @@ -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'); diff --git a/bin/run b/bin/run index ca65bf2e..eaa62fea 100755 --- a/bin/run +++ b/bin/run @@ -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')) diff --git a/src/commands/add.ts b/src/commands/add.ts index 096e844c..76ddb506 100644 --- a/src/commands/add.ts +++ b/src/commands/add.ts @@ -24,9 +24,11 @@ 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', @@ -34,7 +36,7 @@ export class Add extends Command { }), }; - public static readonly args = [ + public static args = [ { name: 'entity', description: 'Github org, repo, or url to add', diff --git a/src/commands/cd.ts b/src/commands/cd.ts index dd6352bc..9a58bad4 100644 --- a/src/commands/cd.ts +++ b/src/commands/cd.ts @@ -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.', diff --git a/src/commands/list.ts b/src/commands/list.ts index 4f478333..fd48f250 100644 --- a/src/commands/list.ts +++ b/src/commands/list.ts @@ -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 { const repositories = (await Repos.create()).getContents(); diff --git a/src/commands/open.ts b/src/commands/open.ts index 7a89502a..960c5434 100644 --- a/src/commands/open.ts +++ b/src/commands/open.ts @@ -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.', diff --git a/src/commands/setup.ts b/src/commands/setup.ts index d5a2e0b4..ce4055e1 100644 --- a/src/commands/setup.ts +++ b/src/commands/setup.ts @@ -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', diff --git a/src/commands/view.ts b/src/commands/view.ts index 66e91aaf..c04c251b 100644 --- a/src/commands/view.ts +++ b/src/commands/view.ts @@ -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.', diff --git a/src/commands/where.ts b/src/commands/where.ts index 69cd8e74..3c1e3b78 100644 --- a/src/commands/where.ts +++ b/src/commands/where.ts @@ -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,