347
// generate the completion script to add to your .bashrc.
348
generateCompletionScript($0: string, cmd: string): string {
350
>
? templates.completionZshTemplate
351
>
: templates.completionShTemplate;
352
>
const name = this.shim.path.basename($0);
353
>
354
>
// add ./ to applications not yet installed as bin.
355
>
if ($0.match(/\.js$/)) $0 = `./${$0}`;
356
>
357
>
script = script.replace(/{{app_name}}/g, name);
358
>
script = script.replace(/{{completion_command}}/g, cmd);
359
>
return script.replace(/{{app_path}}/g, $0);
360
>
}
361
362
// register a function to perform your own custom