@@ -4,7 +4,7 @@ import { Mockttp, getLocal } from 'mockttp';
44import { Interceptor } from '..' ;
55import { HtkConfig } from '../../config' ;
66import { getTerminalEnvVars } from './terminal-env-overrides' ;
7- import { getBashShellScript , getFishShellScript , getPowerShellScript } from './terminal-scripts' ;
7+ import { getBashShellScript , getFishShellScript , getGitBashShellScript , getPowerShellScript } from './terminal-scripts' ;
88
99interface ServerState {
1010 server : Mockttp ;
@@ -18,6 +18,11 @@ const getBashDefinition = (port: number) => ({
1818 command : `eval "$(curl -sS localhost:${ port } /setup)"`
1919} ) ;
2020
21+ const getGitBashDefinition = ( port : number ) => ( {
22+ description : "Git Bash" ,
23+ command : `eval "$(curl -sS localhost:${ port } /gb-setup)"`
24+ } ) ;
25+
2126const getFishDefinition = ( port : number ) => ( {
2227 description : "Fish" ,
2328 command : `curl -sS localhost:${ port } /fish-setup | source`
@@ -31,7 +36,8 @@ const getPowershellDefinition = (port: number) => ({
3136function getShellCommands ( port : number ) : { [ shellName : string ] : ShellDefinition } {
3237 if ( process . platform === 'win32' ) {
3338 return {
34- 'Powershell' : getPowershellDefinition ( port )
39+ 'Powershell' : getPowershellDefinition ( port ) ,
40+ 'Git Bash' : getGitBashDefinition ( port )
3541 }
3642 } else {
3743 return {
@@ -84,6 +90,10 @@ export class ExistingTerminalInterceptor implements Interceptor {
8490 getBashShellScript ( server . urlFor ( '/success' ) , envVars ) ,
8591 { "content-type" : "text/x-shellscript" }
8692 ) ;
93+ await server . forGet ( '/gb-setup' ) . thenReply ( 200 ,
94+ getGitBashShellScript ( server . urlFor ( '/success' ) , envVars ) ,
95+ { "content-type" : "text/x-shellscript" }
96+ ) ;
8797 await server . forGet ( '/fish-setup' ) . thenReply ( 200 ,
8898 getFishShellScript ( server . urlFor ( '/success' ) , envVars ) ,
8999 { "content-type" : "application/x-fish" }
0 commit comments