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 2727
2828! /devcontainer.json
2929! /GHC.Dockerfile
30+ ! /init
31+ ! /init.cmd
3032! /LICENSE
3133! /README.md
3234
Original file line number Diff line number Diff line change @@ -33,3 +33,10 @@ https://github.com/devcontainers/features/blob/main/LICENSE for
3333license information.
3434
3535--------------------------------------------------------------------------------
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 1212 }
1313 },
1414
15+ "initializeCommand" : [" .devcontainer/init" ],
1516 "onCreateCommand" : " onCreateCommand.sh" ,
1617 "postCreateCommand" : " postCreateCommand.sh" ,
1718
Original file line number Diff line number Diff line change 1212 }
1313 },
1414
15+ "initializeCommand" : [" .devcontainer/init" ],
1516 "onCreateCommand" : " onCreateCommand.sh" ,
1617 "postCreateCommand" : " postCreateCommand.sh" ,
1718
Original file line number Diff line number Diff line change 1212 }
1313 },
1414
15+ "initializeCommand" : [" .devcontainer/init" ],
1516 "onCreateCommand" : " onCreateCommand.sh" ,
1617 "postCreateCommand" : " postCreateCommand.sh" ,
1718
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