|
1 | 1 | import * as fs from 'fs-extra'; |
2 | | -import * as path from 'path'; |
3 | 2 | import * as os from 'os'; |
4 | | -import { ShellScriptEditState, ShellSetupState, ShellStartupScriptProvider } from '../startupProvider'; |
5 | | -import { traceError, traceInfo, traceVerbose } from '../../../../common/logging'; |
| 3 | +import * as path from 'path'; |
6 | 4 | import which from 'which'; |
7 | | -import { BASH_ENV_KEY, ZSH_ENV_KEY } from './bashConstants'; |
| 5 | +import { traceError, traceInfo, traceVerbose } from '../../../../common/logging'; |
| 6 | +import { ShellConstants } from '../../../common/shellConstants'; |
8 | 7 | import { hasStartupCode, insertStartupCode, removeStartupCode } from '../common/editUtils'; |
| 8 | +import { ShellScriptEditState, ShellSetupState, ShellStartupScriptProvider } from '../startupProvider'; |
| 9 | +import { BASH_ENV_KEY, ZSH_ENV_KEY } from './bashConstants'; |
9 | 10 |
|
10 | 11 | async function isBashLikeInstalled(): Promise<boolean> { |
11 | 12 | const result = await Promise.all([which('bash', { nothrow: true }), which('sh', { nothrow: true })]); |
@@ -106,6 +107,7 @@ async function removeStartup(profile: string, key: string): Promise<boolean> { |
106 | 107 |
|
107 | 108 | export class BashStartupProvider implements ShellStartupScriptProvider { |
108 | 109 | public readonly name: string = 'Bash'; |
| 110 | + public readonly shellType: string = ShellConstants.BASH; |
109 | 111 |
|
110 | 112 | private async checkShellInstalled(): Promise<boolean> { |
111 | 113 | const found = await isBashLikeInstalled(); |
@@ -168,6 +170,7 @@ export class BashStartupProvider implements ShellStartupScriptProvider { |
168 | 170 |
|
169 | 171 | export class ZshStartupProvider implements ShellStartupScriptProvider { |
170 | 172 | public readonly name: string = 'Zsh'; |
| 173 | + public readonly shellType: string = ShellConstants.ZSH; |
171 | 174 |
|
172 | 175 | private async checkShellInstalled(): Promise<boolean> { |
173 | 176 | const found = await isZshInstalled(); |
@@ -225,6 +228,7 @@ export class ZshStartupProvider implements ShellStartupScriptProvider { |
225 | 228 |
|
226 | 229 | export class GitBashStartupProvider implements ShellStartupScriptProvider { |
227 | 230 | public readonly name: string = 'GitBash'; |
| 231 | + public readonly shellType: string = ShellConstants.GITBASH; |
228 | 232 |
|
229 | 233 | private async checkShellInstalled(): Promise<boolean> { |
230 | 234 | const found = await isGitBashInstalled(); |
|
0 commit comments