Skip to content

Commit 1e87b51

Browse files
aboseclaude
andcommitted
fix: download before uninstall and point prod installer to stable update URL
Swap uninstall/download order in reinstall path so a failed download doesn't leave the user with nothing installed. Rename downloadAndInstall to downloadAndVerifyDeps to reflect what the function actually does. Update prod installer URL to update-latest-stable-prod.json. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 189f927 commit 1e87b51

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

docs/linux/installer-latest-experimental-build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ EOF
456456
print_keyring_hint_if_locked
457457
}
458458

459-
downloadAndInstall() {
459+
downloadAndVerifyDeps() {
460460
echo "Using temporary directory $TMP_DIR for processing"
461461
downloadLatestReleaseInfo > /dev/null
462462
check_architecture
@@ -549,16 +549,16 @@ install() {
549549
echo -e "${YELLOW}Phoenix Code appears to be already installed.${RESET}"
550550
if [ ! -t 0 ]; then
551551
echo -e "${GREEN}Reinstalling Phoenix Code...${RESET}"
552+
downloadAndVerifyDeps
552553
uninstall
553-
downloadAndInstall
554554
copyFilesToDestination
555555
else
556556
read -r -p "Would you like to reinstall it? (y/N): " response
557557
case "$response" in
558558
[Yy]* )
559559
echo -e "${GREEN}Reinstalling Phoenix Code...${RESET}"
560+
downloadAndVerifyDeps
560561
uninstall
561-
downloadAndInstall
562562
copyFilesToDestination
563563
;;
564564
* )
@@ -568,7 +568,7 @@ install() {
568568
esac
569569
fi
570570
else
571-
downloadAndInstall
571+
downloadAndVerifyDeps
572572
copyFilesToDestination
573573
fi
574574
}
@@ -597,7 +597,7 @@ upgrade() {
597597

598598
if [ -n "$latest_version" ] && [ "$(printf '%s\n' "$latest_version" "$current_version" | sort -V | tail -n1)" = "$latest_version" ] && [ "$latest_version" != "$current_version" ]; then
599599
echo -e "${YELLOW}A newer version of Phoenix Code is available. Proceeding with the upgrade...${RESET}"
600-
downloadAndInstall
600+
downloadAndVerifyDeps
601601
uninstall
602602
copyFilesToDestination
603603
echo -e "${GREEN}Upgrade completed successfully. Phoenix Code has been updated to the latest version.${RESET}"

docs/linux/installer.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ set -euo pipefail
2525
# AppImage launch fallbacks.
2626

2727
DESKTOP_DIR=$HOME/.local/share/applications
28-
UPDATE_JSON_URL="https://updates.phcode.io/tauri/update-latest-experimental-build.json"
28+
UPDATE_JSON_URL="https://updates.phcode.io/tauri/update-latest-stable-prod.json"
2929
ICON_URL="https://updates.phcode.io/icons/phoenix_icon.png"
3030
INSTALL_DIR="$HOME/.phoenix-code"
3131
LINK_DIR="$HOME/.local/bin"
@@ -456,7 +456,7 @@ EOF
456456
print_keyring_hint_if_locked
457457
}
458458

459-
downloadAndInstall() {
459+
downloadAndVerifyDeps() {
460460
echo "Using temporary directory $TMP_DIR for processing"
461461
downloadLatestReleaseInfo > /dev/null
462462
check_architecture
@@ -549,16 +549,16 @@ install() {
549549
echo -e "${YELLOW}Phoenix Code appears to be already installed.${RESET}"
550550
if [ ! -t 0 ]; then
551551
echo -e "${GREEN}Reinstalling Phoenix Code...${RESET}"
552+
downloadAndVerifyDeps
552553
uninstall
553-
downloadAndInstall
554554
copyFilesToDestination
555555
else
556556
read -r -p "Would you like to reinstall it? (y/N): " response
557557
case "$response" in
558558
[Yy]* )
559559
echo -e "${GREEN}Reinstalling Phoenix Code...${RESET}"
560+
downloadAndVerifyDeps
560561
uninstall
561-
downloadAndInstall
562562
copyFilesToDestination
563563
;;
564564
* )
@@ -568,7 +568,7 @@ install() {
568568
esac
569569
fi
570570
else
571-
downloadAndInstall
571+
downloadAndVerifyDeps
572572
copyFilesToDestination
573573
fi
574574
}
@@ -597,7 +597,7 @@ upgrade() {
597597

598598
if [ -n "$latest_version" ] && [ "$(printf '%s\n' "$latest_version" "$current_version" | sort -V | tail -n1)" = "$latest_version" ] && [ "$latest_version" != "$current_version" ]; then
599599
echo -e "${YELLOW}A newer version of Phoenix Code is available. Proceeding with the upgrade...${RESET}"
600-
downloadAndInstall
600+
downloadAndVerifyDeps
601601
uninstall
602602
copyFilesToDestination
603603
echo -e "${GREEN}Upgrade completed successfully. Phoenix Code has been updated to the latest version.${RESET}"

0 commit comments

Comments
 (0)