Skip to content

Commit 7e23a86

Browse files
committed
fix: correct run_command exit behavior and improve installation instructions (for Amazon Q) in post-create.sh + fix typos in CONTRIBUTING.md
1 parent 7dffdd3 commit 7e23a86

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

.devcontainer/post-create.sh

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ run_command() {
1717
echo -e "\033[0;31m[ERROR] Command failed (Exit Code $exit_code): $command_to_run\033[0m" >&2
1818
echo -e "\033[0;31m$output\033[0m" >&2
1919

20-
return $exit_code
20+
exit $exit_code
2121
fi
2222
}
2323

2424
# Note: We use Bun (instead of npm) as our package manager for its speed and overall efficiency
2525
# It is a drop-in replacement for Node.js, so we can install npm packages through it without issues
2626
echo "📦 Installing Bun Package Manager..."
2727
run_command "curl -fsSL https://bun.sh/install | bash"
28-
run_command "source ~/.bashrc"
2928
echo "✅ Done"
3029

3130
export BUN_INSTALL="$HOME/.bun"
@@ -61,11 +60,33 @@ echo -e "\n🤖 Installing OpenCode CLI..."
6160
run_command "bun add --global opencode-ai@latest"
6261
echo "✅ Done"
6362

64-
echo -e "\n🤖 Installing Amazon Developer Q CLI..."
65-
run_command "curl --proto '=https' --tlsv1.2 -sSf \"https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip\" -o \"q.zip\""
66-
run_command "unzip q.zip && rm q.zip"
63+
64+
echo -e "\n🤖 Installing Amazon Q CLI..."
65+
# 👉🏾 https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-verify-download.html
66+
67+
run_command "curl --proto '=https' --tlsv1.2 -sSf 'https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip' -o 'q.zip'"
68+
run_command "curl --proto '=https' --tlsv1.2 -sSf 'https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip.sig' -o 'q.zip.sig'"
69+
cat > amazonq-public-key.asc << 'EOF'
70+
-----BEGIN PGP PUBLIC KEY BLOCK-----
71+
72+
mDMEZig60RYJKwYBBAHaRw8BAQdAy/+G05U5/EOA72WlcD4WkYn5SInri8pc4Z6D
73+
BKNNGOm0JEFtYXpvbiBRIENMSSBUZWFtIDxxLWNsaUBhbWF6b24uY29tPoiZBBMW
74+
CgBBFiEEmvYEF+gnQskUPgPsUNx6jcJMVmcFAmYoOtECGwMFCQPCZwAFCwkIBwIC
75+
IgIGFQoJCAsCBBYCAwECHgcCF4AACgkQUNx6jcJMVmef5QD/QWWEGG/cOnbDnp68
76+
SJXuFkwiNwlH2rPw9ZRIQMnfAS0A/0V6ZsGB4kOylBfc7CNfzRFGtovdBBgHqA6P
77+
zQ/PNscGuDgEZig60RIKKwYBBAGXVQEFAQEHQC4qleONMBCq3+wJwbZSr0vbuRba
78+
D1xr4wUPn4Avn4AnAwEIB4h+BBgWCgAmFiEEmvYEF+gnQskUPgPsUNx6jcJMVmcF
79+
AmYoOtECGwwFCQPCZwAACgkQUNx6jcJMVmchMgEA6l3RveCM0YHAGQaSFMkguoAo
80+
vK6FgOkDawgP0NPIP2oA/jIAO4gsAntuQgMOsPunEdDeji2t+AhV02+DQIsXZpoB
81+
=f8yY
82+
-----END PGP PUBLIC KEY BLOCK-----
83+
EOF
84+
run_command "gpg --batch --import amazonq-public-key.asc"
85+
run_command "gpg --verify q.zip.sig q.zip"
86+
run_command "unzip -q q.zip"
87+
run_command "chmod +x ./q/install.sh"
6788
run_command "./q/install.sh --no-confirm"
68-
run_command "rm -rf ./q"
89+
run_command "rm -rf ./q q.zip q.zip.sig amazonq-public-key.asc"
6990
echo "✅ Done"
7091

7192
# Installing UV (Python package manager)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ These are one time installations required to be able to test your changes locall
1414
1. Have an [AI coding agent available](README.md#-supported-ai-agents)
1515

1616
<details>
17-
<summary><b>💡 Hint if you are using <code>VSCode</code> or <code>Github Codespaces</code> as your IDE</b></summary>
17+
<summary><b>💡 Hint if you are using <code>VSCode</code> or <code>GitHub Codespaces</code> as your IDE</b></summary>
1818

1919
<br>
2020

@@ -26,7 +26,7 @@ To do so, simply:
2626
- Open it with VSCode
2727
- Open the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and select "Dev Containers: Open Folder in Container..."
2828

29-
On [Github Codespaces](https://github.com/features/codespaces) it's even simpler, as it leverages the `.devcontainer/devcontainer.json` automatically upon opening the codespace.
29+
On [GitHub Codespaces](https://github.com/features/codespaces) it's even simpler, as it leverages the `.devcontainer/devcontainer.json` automatically upon opening the codespace.
3030

3131
</details>
3232

0 commit comments

Comments
 (0)