@@ -4,7 +4,7 @@ import { Mockttp, getLocal } from 'mockttp';
4
4
import { Interceptor } from '..' ;
5
5
import { HtkConfig } from '../../config' ;
6
6
import { getTerminalEnvVars } from './terminal-env-overrides' ;
7
- import { getBashShellScript , getFishShellScript , getPowerShellScript } from './terminal-scripts' ;
7
+ import { getBashShellScript , getFishShellScript , getGitBashShellScript , getPowerShellScript } from './terminal-scripts' ;
8
8
9
9
interface ServerState {
10
10
server : Mockttp ;
@@ -18,6 +18,11 @@ const getBashDefinition = (port: number) => ({
18
18
command : `eval "$(curl -sS localhost:${ port } /setup)"`
19
19
} ) ;
20
20
21
+ const getGitBashDefinition = ( port : number ) => ( {
22
+ description : "Git Bash" ,
23
+ command : `eval "$(curl -sS localhost:${ port } /gb-setup)"`
24
+ } ) ;
25
+
21
26
const getFishDefinition = ( port : number ) => ( {
22
27
description : "Fish" ,
23
28
command : `curl -sS localhost:${ port } /fish-setup | source`
@@ -31,7 +36,8 @@ const getPowershellDefinition = (port: number) => ({
31
36
function getShellCommands ( port : number ) : { [ shellName : string ] : ShellDefinition } {
32
37
if ( process . platform === 'win32' ) {
33
38
return {
34
- 'Powershell' : getPowershellDefinition ( port )
39
+ 'Powershell' : getPowershellDefinition ( port ) ,
40
+ 'Git Bash' : getGitBashDefinition ( port )
35
41
}
36
42
} else {
37
43
return {
@@ -84,6 +90,10 @@ export class ExistingTerminalInterceptor implements Interceptor {
84
90
getBashShellScript ( server . urlFor ( '/success' ) , envVars ) ,
85
91
{ "content-type" : "text/x-shellscript" }
86
92
) ;
93
+ await server . forGet ( '/gb-setup' ) . thenReply ( 200 ,
94
+ getGitBashShellScript ( server . urlFor ( '/success' ) , envVars ) ,
95
+ { "content-type" : "text/x-shellscript" }
96
+ ) ;
87
97
await server . forGet ( '/fish-setup' ) . thenReply ( 200 ,
88
98
getFishShellScript ( server . urlFor ( '/success' ) , envVars ) ,
89
99
{ "content-type" : "application/x-fish" }
0 commit comments