1
1
#! /usr/bin/env sh
2
2
3
3
if ! command -v git > /dev/null; then
4
- echo " git is not installed"
5
- exit 1
4
+ echo " git is not installed"
5
+ exit 1
6
6
fi
7
7
8
8
if ! command -v curl > /dev/null; then
9
- echo " curl is not installed"
10
- exit 1
9
+ echo " curl is not installed"
10
+ exit 1
11
11
fi
12
12
13
13
if ! command -v jq > /dev/null; then
14
- echo " jq is not installed"
15
- exit 1
14
+ echo " jq is not installed"
15
+ exit 1
16
16
fi
17
17
18
18
mkdir -p ~ /.ssh/git-commit-signing
19
19
20
20
echo " Downloading SSH key"
21
21
22
22
ssh_key=$( curl --request GET \
23
- --url " ${CODER_AGENT_URL} api/v2/workspaceagents/me/gitsshkey" \
24
- --header " Coder-Session-Token: ${CODER_AGENT_TOKEN} " )
23
+ --url " ${CODER_AGENT_URL} api/v2/workspaceagents/me/gitsshkey" \
24
+ --header " Coder-Session-Token: ${CODER_AGENT_TOKEN} " )
25
25
26
- jq --raw-output " .public_key" > ~ /.ssh/git-commit-signing/coder.pub << EOF
26
+ jq --raw-output " .public_key" > ~ /.ssh/git-commit-signing/coder.pub << EOF
27
27
$ssh_key
28
28
EOF
29
29
30
- jq --raw-output " .private_key" > ~ /.ssh/git-commit-signing/coder << EOF
30
+ jq --raw-output " .private_key" > ~ /.ssh/git-commit-signing/coder << EOF
31
31
$ssh_key
32
32
EOF
33
33
@@ -38,4 +38,4 @@ echo "Configuring git to use the SSH key"
38
38
39
39
git config --global gpg.format ssh
40
40
git config --global commit.gpgsign true
41
- git config --global user.signingkey ~ /.ssh/git-commit-signing/coder
41
+ git config --global user.signingkey ~ /.ssh/git-commit-signing/coder
0 commit comments