Skip to content

Commit

Permalink
fix: stop hard-coding default guidebook
Browse files Browse the repository at this point in the history
This PR allows client plugins to specify the default guidebook in config.d/client "defaultGuidebook", e.g.

```
{
  "defaultGuidebook": "ml/codeflare"
}
```
  • Loading branch information
starpit committed Sep 28, 2022
1 parent 4fe63d6 commit 4654609
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugins/plugin-client-default/config.d/client.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"defaultGuidebook": "ml/codeflare",
"contextRoot": ""
}
3 changes: 2 additions & 1 deletion plugins/plugin-madwizard/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import { defaultGuidebook } from "@kui-shell/client/config.d/client.json"
import { Arguments, ParsedOptions, ReactResponse, Registrar, Tab } from "@kui-shell/core"

export interface Options extends ParsedOptions {
Expand Down Expand Up @@ -104,7 +105,7 @@ export function doMadwizard({ readonlyUI = true, task, withFilepath = true, cb,
return async ({ tab, argvNoOptions, parsedOptions }: Arguments<Options>) => {
if (withFilepath && !argvNoOptions[1]) {
// TODO codeflare should not be in plugin-madwizard
argvNoOptions.push(process.env.GUIDEBOOK || "ml/codeflare")
argvNoOptions.push(process.env.GUIDEBOOK || defaultGuidebook)
}

if (envFn) {
Expand Down

0 comments on commit 4654609

Please sign in to comment.