From 5c8a516d0dc0ff11557d627ea65c0c5426201e15 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Wed, 25 Oct 2023 13:41:57 -0600 Subject: [PATCH] fix: remove init hook --- package.json | 5 ----- src/commands/doctor.ts | 3 ++- src/hooks/init/init_doctor.ts | 19 ------------------- 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 src/hooks/init/init_doctor.ts diff --git a/package.json b/package.json index f2044ff0..3c845bff 100644 --- a/package.json +++ b/package.json @@ -85,11 +85,6 @@ "@oclif/plugin-command-snapshot", "@salesforce/plugin-command-reference" ], - "hooks": { - "init": [ - "./lib/hooks/init/init_doctor.js" - ] - }, "topics": { "info": { "description": "Access Salesforce CLI information from the command line.", diff --git a/src/commands/doctor.ts b/src/commands/doctor.ts index fc92003c..ad94740c 100644 --- a/src/commands/doctor.ts +++ b/src/commands/doctor.ts @@ -58,7 +58,8 @@ export default class Doctor extends SfCommand { public async run(): Promise { const { flags } = await this.parse(Doctor); - this.doctor = SFDoctor.getInstance(); + // this.doctor = SFDoctor.getInstance(); + this.doctor = SFDoctor.init(this.config); const lifecycle = Lifecycle.getInstance(); this.outputDir = pathResolve(flags['output-dir'] ?? process.cwd()); diff --git a/src/hooks/init/init_doctor.ts b/src/hooks/init/init_doctor.ts deleted file mode 100644 index 92681d15..00000000 --- a/src/hooks/init/init_doctor.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2020, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -import type { Hook } from '@oclif/core'; -import { Doctor } from '../../doctor.js'; - -const hook: Hook<'init'> = async ({ config, id }): Promise => { - if (id === 'doctor' && !Doctor.isDoctorEnabled()) { - Doctor.init(config); - } - - return Promise.resolve(); -}; - -export default hook;