1
1
import { Args , Flags , ux } from '@oclif/core'
2
- import chalk from 'chalk '
2
+ import { bold , cyan } from 'ansis '
3
3
import { EOL } from 'node:os'
4
4
5
5
import { AutocompleteBase } from '../../base.js'
@@ -38,7 +38,7 @@ export default class Index extends AutocompleteBase {
38
38
)
39
39
}
40
40
41
- ux . action . start ( `${ chalk . bold ( 'Building the autocomplete cache' ) } ` )
41
+ ux . action . start ( `${ bold ( 'Building the autocomplete cache' ) } ` )
42
42
await Create . run ( [ ] , this . config )
43
43
ux . action . stop ( )
44
44
@@ -62,22 +62,22 @@ Setup Instructions for ${this.config.bin.toUpperCase()} CLI Autocomplete ---
62
62
instructions += `
63
63
1) Run this command in your terminal window:
64
64
65
- ${ chalk . cyan ( `printf "eval $(${ scriptCommand } )" >> ~/.bashrc; source ~/.bashrc` ) }
65
+ ${ cyan ( `printf "eval $(${ scriptCommand } )" >> ~/.bashrc; source ~/.bashrc` ) }
66
66
67
- The previous command adds the ${ chalk . cyan ( setupEnvVar ) } environment variable to your Bash config file and then sources the file.
67
+ The previous command adds the ${ cyan ( setupEnvVar ) } environment variable to your Bash config file and then sources the file.
68
68
69
- ${ chalk . bold ( 'NOTE' ) } : If you’ve configured your terminal to start as a login shell, you may need to modify the command so it updates either the ~/.bash_profile or ~/.profile file. For example:
69
+ ${ bold ( 'NOTE' ) } : If you’ve configured your terminal to start as a login shell, you may need to modify the command so it updates either the ~/.bash_profile or ~/.profile file. For example:
70
+
71
+ ${ cyan ( `printf "eval $(${ scriptCommand } ) >> ~/.bash_profile; source ~/.bash_profile` ) }
70
72
71
- ${ chalk . cyan ( `printf "eval $(${ scriptCommand } ) >> ~/.bash_profile; source ~/.bash_profile` ) }
72
-
73
73
Or:
74
74
75
- ${ chalk . cyan ( `printf "eval $(${ scriptCommand } )" >> ~/.profile; source ~/.profile` ) }
75
+ ${ cyan ( `printf "eval $(${ scriptCommand } )" >> ~/.profile; source ~/.profile` ) }
76
76
77
77
2) Start using autocomplete:
78
78
79
- ${ chalk . cyan ( `${ this . config . bin } ${ tabStr } ` ) } # Command completion
80
- ${ chalk . cyan ( `${ this . config . bin } command --${ tabStr } ` ) } # Flag completion
79
+ ${ cyan ( `${ this . config . bin } ${ tabStr } ` ) } # Command completion
80
+ ${ cyan ( `${ this . config . bin } command --${ tabStr } ` ) } # Flag completion
81
81
`
82
82
break
83
83
}
@@ -86,18 +86,18 @@ Setup Instructions for ${this.config.bin.toUpperCase()} CLI Autocomplete ---
86
86
instructions += `
87
87
1) Run this command in your terminal window:
88
88
89
- ${ chalk . cyan ( `printf "eval $(${ scriptCommand } )" >> ~/.zshrc; source ~/.zshrc` ) }
89
+ ${ cyan ( `printf "eval $(${ scriptCommand } )" >> ~/.zshrc; source ~/.zshrc` ) }
90
90
91
- The previous command adds the ${ chalk . cyan ( setupEnvVar ) } environment variable to your zsh config file and then sources the file.
91
+ The previous command adds the ${ cyan ( setupEnvVar ) } environment variable to your zsh config file and then sources the file.
92
92
93
93
2) (Optional) Run this command to ensure that you have no permissions conflicts:
94
94
95
- ${ chalk . cyan ( 'compaudit -D' ) }
95
+ ${ cyan ( 'compaudit -D' ) }
96
96
97
97
3) Start using autocomplete:
98
98
99
- ${ chalk . cyan ( `${ this . config . bin } ${ tabStr } ` ) } # Command completion
100
- ${ chalk . cyan ( `${ this . config . bin } command --${ tabStr } ` ) } # Flag completion
99
+ ${ cyan ( `${ this . config . bin } ${ tabStr } ` ) } # Command completion
100
+ ${ cyan ( `${ this . config . bin } command --${ tabStr } ` ) } # Flag completion
101
101
`
102
102
break
103
103
}
@@ -106,17 +106,17 @@ Setup Instructions for ${this.config.bin.toUpperCase()} CLI Autocomplete ---
106
106
instructions += `
107
107
1) Run these two cmdlets in your PowerShell window in the order shown:
108
108
109
- ${ chalk . cyan ( `New-Item -Type Directory -Path (Split-Path -Parent $PROFILE) -ErrorAction SilentlyContinue
109
+ ${ cyan ( `New-Item -Type Directory -Path (Split-Path -Parent $PROFILE) -ErrorAction SilentlyContinue
110
110
Add-Content -Path $PROFILE -Value (Invoke-Expression -Command "${ scriptCommand } "); .$PROFILE` ) }
111
111
112
112
2) (Optional) If you want matching completions printed below the command line, run this cmdlet:
113
113
114
- ${ chalk . cyan ( 'Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete' ) }
114
+ ${ cyan ( 'Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete' ) }
115
115
116
116
3) Start using autocomplete:
117
117
118
- ${ chalk . cyan ( `${ this . config . bin } ${ tabStr } ` ) } # Command completion
119
- ${ chalk . cyan ( `${ this . config . bin } command --${ tabStr } ` ) } # Flag completion
118
+ ${ cyan ( `${ this . config . bin } ${ tabStr } ` ) } # Command completion
119
+ ${ cyan ( `${ this . config . bin } command --${ tabStr } ` ) } # Flag completion
120
120
`
121
121
break
122
122
}
0 commit comments