Skip to content

Commit 76a3af5

Browse files
committed
harden curl installer release path
1 parent 7c7e396 commit 76a3af5

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

install.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DHEE_HOME="$HOME/.dhee"
2121
VENV_DIR="$DHEE_HOME/.venv"
2222
BIN_DIR="$HOME/.local/bin"
2323
MIN_PYTHON="3.9"
24-
PACKAGE="dhee[app]"
24+
PACKAGE="dhee[app]>=6.0.1"
2525

2626
# --- Colors ---
2727
if [ -t 1 ]; then
@@ -73,7 +73,7 @@ fi
7373

7474
# --- Install package ---
7575
"$VENV_DIR/bin/pip" install --upgrade pip -q 2>/dev/null
76-
"$VENV_DIR/bin/pip" install --upgrade "$PACKAGE" -q
76+
"$VENV_DIR/bin/pip" install --upgrade --no-cache-dir "$PACKAGE" -q
7777
done_ "Installed dhee"
7878

7979
# --- Symlink binaries ---
@@ -128,14 +128,17 @@ NONINTERACTIVE_DONE=0
128128
if [ -n "${DHEE_PROVIDER:-}" ] && [ -n "${DHEE_API_KEY:-}" ]; then
129129
info "Non-interactive onboarding for provider: ${DHEE_PROVIDER}"
130130
if "$VENV_DIR/bin/python" -c "
131-
import sys
131+
import os, sys
132+
from dhee.cli_onboard import _save_provider_in_config
132133
from dhee.secret_store import store_api_key
133134
try:
134-
store_api_key('${DHEE_PROVIDER}', '${DHEE_API_KEY}', label='installer')
135+
provider = os.environ['DHEE_PROVIDER']
136+
_save_provider_in_config(provider)
137+
store_api_key(provider, os.environ['DHEE_API_KEY'], label='installer')
135138
except Exception as e:
136139
print(e, file=sys.stderr); sys.exit(1)
137140
" >/dev/null 2>&1; then
138-
done_ "API key stored for ${DHEE_PROVIDER}"
141+
done_ "Provider configured and API key stored for ${DHEE_PROVIDER}"
139142
NONINTERACTIVE_DONE=1
140143
else
141144
warn "Non-interactive key storage failed — falling back to prompt"
@@ -144,7 +147,7 @@ fi
144147

145148
ONBOARD_STATUS=0
146149
if [ "$NONINTERACTIVE_DONE" = "1" ]; then
147-
"$VENV_DIR/bin/dhee" onboard --provider "${DHEE_PROVIDER}" || ONBOARD_STATUS=$?
150+
info "Skipping interactive onboarding"
148151
else
149152
# Interactive: onboard reads from /dev/tty so this works under curl | sh.
150153
if [ -r /dev/tty ]; then

0 commit comments

Comments
 (0)