Skip to content
Snippets Groups Projects
Select Git revision
  • a4d97e4faf98c21f924e2c0fa4f3a38476a6ea53
  • main default protected
  • jw_sonar
  • v6.0.0 protected
  • interactive-mode-preference
  • bedran_exercise-list
  • add_route_user
  • Jw_sonar_backup
  • exercise_list_filter
  • assignment_filter
  • add_route_assignments
  • move-to-esm-only
  • 6.0.0-dev
  • Pre-alpha
  • 5.0.0
  • Latest
  • 4.2.0
  • 4.1.1
  • 4.1.0
  • 4.0.1
  • 4.0.0
  • 3.5.0
  • 3.4.2
  • 3.4.1
  • 3.3.0
  • 3.2.3
  • 3.2.2
  • 3.2.0
  • 3.1.2
  • 3.1.1
  • 3.1.0
  • 3.0.1
32 results

CompletionBashCommand.ts

Blame
  • CompletionBashCommand.ts 802 B
    import CommanderCommand from '../../CommanderCommand';
    import path             from 'path';
    import os               from 'os';
    import { updateRcFile } from '../../../helpers/AutoCompletionHelper';
    
    
    class CompletionBashCommand extends CommanderCommand {
        protected commandName: string = 'bash';
    
        private readonly bashrcPath = path.join(os.homedir(), '.bashrc');
        private readonly completionCommand = `
    # Added by DojoCLI
    source <(dojo completion script bash)
    `;
    
        protected defineCommand() {
            this.command.description('generate bash completion')
                .action(this.commandAction.bind(this));
        }
    
        protected async commandAction(): Promise<void> {
            updateRcFile('bash', this.bashrcPath, this.completionCommand);
        }
    }
    
    
    export default new CompletionBashCommand();