fix: Absolute path for ASDF registry in script

This commit is contained in:
2026-04-16 16:28:34 -04:00
parent 36d1e0e842
commit 51b6651b03
3 changed files with 108 additions and 38 deletions

View File

@@ -9,27 +9,33 @@ prompt_user() {
local var_name="$3"
local result=""
echo -n -e "${YELLOW}$prompt (default: $default): ${NC}" >&2
if read -t 5 result; then :; else result="$default"; echo -e "${BLUE} [Auto-Selected: $default]${NC}" >&2 fi
if read -t 5 result; then :; else result="$default"; echo -e "${BLUE} [Auto-Selected: $default]${NC}" >&2; fi
val=${result:-$default}
eval "$var_name=\"$val\""
}
# 1. Dependencies
if ! command -v sbcl >/dev/null 2>&1; then
echo -e "${BLUE}Installing dependencies...${NC}"
sudo apt-get update && sudo apt-get install -y sbcl emacs git curl socat || true
fi
# 2. Quicklisp
if [ ! -d "$HOME/quicklisp" ]; then
curl -O https://beta.quicklisp.org/quicklisp.lisp
sbcl --non-interactive --load quicklisp.lisp --eval "(quicklisp-quickstart:install)" --eval "(ql-util:without-prompting (ql:add-to-init-file))"
rm quicklisp.lisp
fi
# 3. Tangling
echo -e "${BLUE}Tangling source files...${NC}"
mkdir -p src
for f in literate/*.org; do
echo " - Tangling $f"
emacs --batch --eval "(require 'org)" --eval "(org-babel-tangle-file \"$f\")" >/dev/null 2>&1
done
# 4. Config
if [ ! -f .env ]; then cp .env.example .env; fi
prompt_user "What is your name?" "User" "USER_NAME"
prompt_user "What shall we name your Assistant?" "OpenCortex" "AGENT_NAME"
@@ -38,15 +44,16 @@ prompt_user "Select provider (1:Gemini, 2:OpenRouter)" "1" "LLM_CHOICE"
sed -i "s/MEMEX_USER=.*/MEMEX_USER=\"$USER_NAME\"/g" .env
sed -i "s/MEMEX_ASSISTANT=.*/MEMEX_ASSISTANT=\"$AGENT_NAME\"/g" .env
ROOT_DIR=$(pwd)
sed -i "s|MEMEX_DIR=.*|MEMEX_DIR=\"$(dirname $ROOT_DIR)\"|g" .env
sed -i "s|SKILLS_DIR=.*|SKILLS_DIR=\"$ROOT_DIR/skills\"|g" .env
# 5. Path Alignment
INSTALL_DIR="$(cd "$(dirname "$0")/.." && pwd)"
sed -i "s|MEMEX_DIR=.*|MEMEX_DIR=\"$(dirname "$INSTALL_DIR")\"|g" .env
sed -i "s|SKILLS_DIR=.*|SKILLS_DIR=\"$INSTALL_DIR/skills\"|g" .env
mkdir -p "$HOME/.local/bin"
ln -sf "$ROOT_DIR/opencortex.sh" "$HOME/.local/bin/opencortex"
ln -sf "$INSTALL_DIR/opencortex.sh" "$HOME/.local/bin/opencortex"
echo -e "${GREEN}✓ Installed 'opencortex' command to ~/.local/bin${NC}"
echo -e "\n${GREEN}==============================================${NC}"
echo -e "${GREEN} OpenCortex Installation Complete! ${NC}"
echo -e "${GREEN}==============================================${NC}"
echo -e " OpenCortex Installation Complete! "
echo -e "==============================================${NC}"
echo -e "To start: opencortex"