This repository was archived by the owner on Mar 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { EXIT_STATUS } from "../../constants";
88import { KmdrAuthError } from "../../errors" ;
99import { GetProgramAstResponse , SaveFeedbackResponse } from "../../interfaces" ;
1010import Print from "../../Print" ;
11+ import chalk from "chalk" ;
1112
1213interface ExplainInputQuery {
1314 source : string ;
@@ -78,7 +79,8 @@ export default class Explain extends CLI {
7879
7980 Print . newLine ( ) ;
8081
81- Print . text ( `Learn more at ${ this . KMDR_WEBAPP_URI } /history/${ commandId } ` ) ;
82+ const detailsUrl = this . detailsURL ( commandId ) ;
83+ Print . text ( `Open in browser ${ detailsUrl } ` ) ;
8284 Print . newLine ( ) ;
8385
8486 // what do you want to do next?
@@ -242,4 +244,13 @@ export default class Explain extends CLI {
242244
243245 return source ;
244246 }
247+
248+ private detailsURL ( id : string ) {
249+ const url =
250+ this . NODE_ENV === "production"
251+ ? `https://h.kmdr.sh/${ id } `
252+ : `${ this . KMDR_WEBAPP_URI } /history/${ id } ` ;
253+
254+ return chalk . blueBright . bold . underline ( url ) ;
255+ }
245256}
You can’t perform that action at this time.
0 commit comments