Some checks failed
E2E Tests / E2E Test (Linux) - ${{ matrix.sandbox }} (20.x, sandbox:docker) (push) Has been cancelled
E2E Tests / E2E Test (Linux) - ${{ matrix.sandbox }} (20.x, sandbox:none) (push) Has been cancelled
E2E Tests / E2E Test (Linux) - ${{ matrix.sandbox }} (22.x, sandbox:docker) (push) Has been cancelled
E2E Tests / E2E Test (Linux) - ${{ matrix.sandbox }} (22.x, sandbox:none) (push) Has been cancelled
E2E Tests / E2E Test (Linux) - ${{ matrix.sandbox }} (24.x, sandbox:docker) (push) Has been cancelled
E2E Tests / E2E Test (Linux) - ${{ matrix.sandbox }} (24.x, sandbox:none) (push) Has been cancelled
E2E Tests / E2E Test - macOS (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Qwen Scheduled Issue Triage / triage-issues (push) Has been cancelled
No Response / no-response (push) Has been cancelled
📋 Gemini Scheduled Issue Deduplication / refresh-embeddings (push) Has been cancelled
Qwen Scheduled PR Triage 🚀 / audit-prs (push) Has been cancelled
40 lines
1.1 KiB
Bash
40 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# This script creates an alias for the Gemini CLI
|
|
|
|
# Determine the project directory
|
|
PROJECT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
|
ALIAS_COMMAND="alias qwen='node "${PROJECT_DIR}/scripts/start.js"'"
|
|
|
|
# Detect shell and set config file path
|
|
if [[ "${SHELL}" == *"/bash" ]]; then
|
|
CONFIG_FILE="${HOME}/.bashrc"
|
|
elif [[ "${SHELL}" == *"/zsh" ]]; then
|
|
CONFIG_FILE="${HOME}/.zshrc"
|
|
else
|
|
echo "Unsupported shell. Only bash and zsh are supported."
|
|
exit 1
|
|
fi
|
|
|
|
echo "This script will add the following alias to your shell configuration file (${CONFIG_FILE}):"
|
|
echo " ${ALIAS_COMMAND}"
|
|
echo ""
|
|
|
|
# Check if the alias already exists
|
|
if grep -q "alias qwen=" "${CONFIG_FILE}"; then
|
|
echo "A 'qwen' alias already exists in ${CONFIG_FILE}. No changes were made."
|
|
exit 0
|
|
fi
|
|
|
|
read -p "Do you want to proceed? (y/n) " -n 1 -r
|
|
echo ""
|
|
if [[ "${REPLY}" =~ ^[Yy]$ ]]; then
|
|
echo "${ALIAS_COMMAND}" >> "${CONFIG_FILE}"
|
|
echo ""
|
|
echo "Alias added to ${CONFIG_FILE}."
|
|
echo "Please run 'source ${CONFIG_FILE}' or open a new terminal to use the 'qwen' command."
|
|
else
|
|
echo "Aborted. No changes were made."
|
|
fi
|