@@ -147,14 +147,40 @@ rm session-manager-plugin.rpm
147147# # Run the fix script from the same directory
148148# bash "$(dirname "$0")/fix-bash-preexec.sh"
149149
150- echo " Installing Kiro CLI (optional) ..."
151- if curl -fsSL https://cli.kiro.dev/install | bash 2>&1 | tee /tmp/kiro-install.log; then
152- echo " alias kc='AMAZON_Q_SIGV4=1 kiro-cli'" | sudo tee -a /etc/profile.d/workshop.sh
153- echo " Kiro CLI installed successfully"
154- else
155- echo " ⚠️ Kiro CLI installation failed (optional component)"
156- echo " Installation log saved to /tmp/kiro-install.log"
157- fi || true
150+ # echo "Installing Kiro CLI (optional) ..."
151+ # if curl -fsSL https://cli.kiro.dev/install | bash 2>&1 | tee /tmp/kiro-install.log; then
152+ # echo "alias kc='AMAZON_Q_SIGV4=1 kiro-cli'" | sudo tee -a /etc/profile.d/workshop.sh
153+ # echo "Kiro CLI installed successfully"
154+ # else
155+ # echo "⚠️ Kiro CLI installation failed (optional component)"
156+ # echo "Installation log saved to /tmp/kiro-install.log"
157+ # fi || true
158+
159+ # Installing Q CLI (with error handling)
160+ echo " Installing Q CLI..."
161+
162+ {
163+ curl --proto ' =https' --tlsv1.2 -sSf " https://desktop-release.codewhisperer.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip" -o /home/ec2-user/q.zip && \
164+ unzip -q /home/ec2-user/q.zip -d /home/ec2-user/ && \
165+ chmod +x /home/ec2-user/q/install.sh && \
166+ sudo Q_INSTALL_GLOBAL=1 /home/ec2-user/q/install.sh && \
167+ echo " ✓ Q CLI installed successfully"
168+
169+ # Fix bash-preexec if install succeeded
170+ if [ -f " $( dirname " $0 " ) /fix-bash-preexec.sh" ]; then
171+ bash " $( dirname " $0 " ) /fix-bash-preexec.sh" || echo " ⚠ Warning: bash-preexec fix failed (non-critical)"
172+ fi
173+
174+ # Add Q CLI alias
175+ echo " alias qc='AMAZON_Q_SIGV4=1 q chat'" | sudo tee -a /etc/profile.d/workshop.sh > /dev/null
176+ echo " ✓ Q CLI alias 'qc' added"
177+ } || echo " ⚠ Warning: Q CLI installation failed (non-critical)"
178+
179+ # Cleanup (always runs)
180+ rm -f /home/ec2-user/q.zip 2> /dev/null || true
181+ rm -rf /home/ec2-user/q 2> /dev/null || true
182+
183+ echo " Continuing with setup..."
158184
159185echo " Installing Spring CLI (optional) ..."
160186if curl -L https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/3.5.0/spring-boot-cli-3.5.0-bin.zip -o /home/ec2-user/spring-boot-cli-3.5.0-bin.zip 2> /dev/null; then
0 commit comments