File tree Expand file tree Collapse file tree 7 files changed +44
-0
lines changed Expand file tree Collapse file tree 7 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 27
27
28
28
! /devcontainer.json
29
29
! /GHC.Dockerfile
30
+ ! /init
31
+ ! /init.cmd
30
32
! /LICENSE
31
33
! /README.md
32
34
Original file line number Diff line number Diff line change @@ -33,3 +33,10 @@ https://github.com/devcontainers/features/blob/main/LICENSE for
33
33
license information.
34
34
35
35
--------------------------------------------------------------------------------
36
+ .devcontainer/init
37
+ Copyright (c) 2025 b-data GmbH
38
+ Copyright (c) 2023 Microsoft Corporation
39
+
40
+ Distributed under the terms of the MIT License.
41
+
42
+ --------------------------------------------------------------------------------
Original file line number Diff line number Diff line change 12
12
}
13
13
},
14
14
15
+ "initializeCommand" : [" .devcontainer/init" ],
15
16
"onCreateCommand" : " onCreateCommand.sh" ,
16
17
"postCreateCommand" : " postCreateCommand.sh" ,
17
18
Original file line number Diff line number Diff line change 12
12
}
13
13
},
14
14
15
+ "initializeCommand" : [" .devcontainer/init" ],
15
16
"onCreateCommand" : " onCreateCommand.sh" ,
16
17
"postCreateCommand" : " postCreateCommand.sh" ,
17
18
Original file line number Diff line number Diff line change 12
12
}
13
13
},
14
14
15
+ "initializeCommand" : [" .devcontainer/init" ],
15
16
"onCreateCommand" : " onCreateCommand.sh" ,
16
17
"postCreateCommand" : " postCreateCommand.sh" ,
17
18
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Copyright (c) 2025 b-data GmbH
3
+ # Copyright (c) 2023 Microsoft Corporation
4
+ # Distributed under the terms of the MIT License.
5
+ #
6
+ # https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials
7
+ # https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases?platform=windows
8
+ #
9
+ # Modified by b-data for seamless use with development containers.
10
+
11
+ set -e
12
+
13
+ if [ -z " $CODESPACES " ] && [ " $( command -v ssh-agent) " ]; then
14
+ if [ -z " $SSH_AUTH_SOCK " ]; then
15
+ # Check for a currently running instance of the agent
16
+ RUNNING_AGENT=" $( pgrep -f ' ssh-agent -s' | wc -l | tr -d ' [:space:]' ) "
17
+ if [ " $RUNNING_AGENT " = " 0" ] || [ ! -f " $HOME /.ssh/ssh-agent" ]; then
18
+ mkdir -p -m 0700 " $HOME /.ssh"
19
+ # Launch a new instance of the agent
20
+ ssh-agent -s & > " $HOME /.ssh/ssh-agent"
21
+ fi
22
+ eval " $( cat " $HOME /.ssh/ssh-agent" ) " > /dev/null
23
+ fi
24
+ # Check the state of the currently running instance of the agent
25
+ # 0: running with key(s); 1: running w/o key(s); 2: not running
26
+ AGENT_RUN_STATE=" $( ssh-add -l > /dev/null 2>&1 ; echo $? ) "
27
+ # Only add key(s) if running w/o key(s)
28
+ if [ " $AGENT_RUN_STATE " = " 1" ]; then
29
+ ssh-add 2> /dev/null || true
30
+ fi
31
+ # Means: Not adding key(s) to a forwarded agent with key(s)
32
+ fi
You can’t perform that action at this time.
0 commit comments