HiveMinds / Productivity-phone

Automatically installs (mainly) opensource system on phone that optimizes user productivity.
GNU Affero General Public License v3.0
2 stars 1 forks source link

Remove reliance on output files for installation status checks. #28

Open a-t-0 opened 3 years ago

a-t-0 commented 3 years ago

Most checks are performed based on data that is exported to files. This is because an function on bash can normally only return 1 (or 2) variables (possibly more in the form of a list).

Yet variables being returned from a function directly make testing it less convoluted. It is assumed that testing a function output directly instead of via a file is preferred. Furthermore, it is assumed that the code becomes more entangled/spagettified if each variable is passed and returned throughout multiple functions. However while typing it out, this seems to be the preferred programming approach, where a single variable is passed around in a controlled fashion instead of arbitrary file output that may be affected and read out by various functions at arbitrary moments.

Hence it is assumed that it is preferred to output as little variables/data to files as possible for verification/later use, and to maximise the amount of variables that are returned at the end of a function.

If the assumption is verified: