zen-browser / desktop

🌀 Experience tranquillity while browsing the web without people tracking you!
https://zen-browser.app
Mozilla Public License 2.0
13.28k stars 315 forks source link

Linux command-line installer offers invalid option #1651

Open BarryTice opened 5 hours ago

BarryTice commented 5 hours ago

Captchas

What happened?

I am installing the "generic" version in Ubuntu (20.04), though I didn't quite follow directions. Rather than curling the bash script and directing it to bash, I downloaded the file (in order to review it), set the execute bit, and ran it directly. (This does not affect the nature of this bug.)

When you launch the appimage.sh script to install the appimage that you've already downloaded, you get this list of options, which says that your choices are 0 through 3. However 3 is clearly not a valid option.

[i] (★^O^★) What would you like to do?
[i]   1) Install
[i]   2) Uninstall
[i]   0) Exit
Enter your choice (0-3): 3
[e] (•ˋ _ ˊ•) Invalid choice. Exiting...

If 3 is not a valid choice, then the Enter your choice (0-3): message should only say Enter your choice (0-2):

Reproducible?

Version

1.0.1-a.3

What platform are you seeing the problem on?

Linux

Relevant log output

barry@barry-bob:~/Downloads$ ./appimage.sh 
[i] ╔════════════════════════════════════════════════════╗
[i] ║                                                    ║
[i] ║    (ノ◕ヮ◕)ノ*:・゚✧  Zen Browser Installer            ║
[i] ║                                                    ║
[i] ║    CPU: AVX2 Supported (Optimized Version)         ║
[i] ║    Status: Zen Browser Installed                   ║
[i] ║    zsync: Not Installed (Needed for Updates)       ║
[i] ║                                                    ║
[i] ╚════════════════════════════════════════════════════╝
[i] 
[i] (★^O^★) What would you like to do?
[i]   1) Install
[i]   2) Uninstall
[i]   0) Exit
Enter your choice (0-3): 3
[e] (•ˋ _ ˊ•) Invalid choice. Exiting...
linear[bot] commented 5 hours ago

ZEN-1687 Linux command-line installer offers invalid option

BarryTice commented 4 hours ago

Apparently 3 is valid if I have zsync installed, which, apparently, I don't.

main_menu() {
    log_info "(★^O^★) What would you like to do?"
    log_info "  1) Install"
    log_info "  2) Uninstall"
    if check_zsync_installed; then
        log_info "  3) Check for Updates"
    fi
    log_info "  0) Exit"
    read -p "Enter your choice (0-3): " main_choice

In any case, the if block at line 276 should conditionally set the "last number in list" to 3 if there is a 3 option, and then line 280 should use that variable rather than the hard-coded 3 value.