uugear / Witty-Pi-4

Software and Firmware for Witty Pi 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation fails and leaves leftover files behind if unzip is not present

nathanael-naeri opened this issue · comments

Installing via install.sh as directed by the PDF documentation. On (at least) a default install of Ubuntu Server 20.04 LTS, unzip is not present, and as a result the installation script fails on that line. A similar line fails in the installation script of UWI.

Now of course running sudo apt install unzip will make it possible to run the installation script successfully, but for the sake of new users, may I suggest that the install script simply installs unzip if it is not present, the exact same way that it installs i2c-tools if that package is not present? Same suggestion for the installation script of UWI.

Alternatively the GZIP format could be preferred, as I believe gzip is present by default in more distributions than unzip is.

Furthermore, because the installation script does not treat the absence of unzip as fatal, it tries to run the rest of the script instead of exiting immediately. The lines after unzip either fail and result in more errors being printed, or succeed and result in leftover files being left behind after installation failure, those lines in particular:

touch wittyPi.log
touch schedule.log

Those leftover files give the impression that installation was somehow successful - since there are log files!

Might I suggest that instead of being counted with the ... || ((ERR++)) syntax, errors that should be treated as fatal lead to the scripts immediately cleaning up what needs to be cleaned and then exiting? After all there is little point in, for instance, trying to unzip wittyPi.zip to proceed with installation if that file could not be downloaded for some reason in the first place.

dear gentlemen, i can agree on this.