Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: update default help class
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Dec 14, 2021
1 parent ac659a5 commit e0cba21
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/_test-help-class.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// `getHelpClass` tests require an oclif project for testing so
// it is re-using the setup here to be able to do a lookup for
// this sample help class file in tests, although it is not needed
// for @oclif/plugin-help itself.
// for @oclif/help itself.

import {HelpBase} from '.'

Expand Down
4 changes: 2 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function extractClass(exported: any): HelpBaseDerived {
return exported && exported.default ? exported.default : exported
}

export function getHelpClass(config: IConfig, defaultClass = '@oclif/plugin-help'): HelpBaseDerived {
export function getHelpClass(config: IConfig, defaultClass = '@oclif/help'): HelpBaseDerived {
const pjson = config.pjson
const configuredClass = pjson && pjson.oclif && pjson.oclif.helpClass

Expand All @@ -82,6 +82,6 @@ export function getHelpClass(config: IConfig, defaultClass = '@oclif/plugin-help
const exported = require(defaultModulePath)
return extractClass(exported) as HelpBaseDerived
} catch (error) {
throw new Error(`Could not load a help class, consider installing the @oclif/plugin-help package, failed with message:\n${error.message}`)
throw new Error(`Could not load a help class, consider installing the @oclif/help package, failed with message:\n${error.message}`)
}
}
2 changes: 1 addition & 1 deletion test/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('util', () => {
test
.it('throws an error when failing to load the default help class', () => {
delete config.pjson.oclif.helpClass
expect(() => getHelpClass(config, 'does-not-exist-default-plugin')).to.throw('Could not load a help class, consider installing the @oclif/plugin-help package, failed with message:')
expect(() => getHelpClass(config, 'does-not-exist-default-plugin')).to.throw('Could not load a help class, consider installing the @oclif/help package, failed with message:')
})

test
Expand Down

0 comments on commit e0cba21

Please sign in to comment.