diff options
author | neoninteger | 2019-11-14 22:32:41 +1030 |
---|---|---|
committer | neoninteger | 2019-11-14 22:32:41 +1030 |
commit | f496d7fba8d3318231698631372491759f7c181f (patch) | |
tree | 4b3b4c6e50cf6a370ca60105f71548d47cb6af94 | |
parent | 7951354b5bedba7de72a1b723b5fb7a8dcdfe18c (diff) | |
download | aur-f496d7fba8d3318231698631372491759f7c181f.tar.gz |
Implement more efficient logging function
-rw-r--r-- | PKGBUILD | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -47,12 +47,6 @@ build() { check() { cd "core-rs-${_commithash}" - # Echoes a blue arrow followed by a bolded log message, much like the - # verbose printing that makepkg itself does - log() { - echo -e " $(tput setaf 4)$(tput bold)->$(tput sgr0) $(tput bold)$@$(tput sgr0)" - } - # NOTE: The integration tests need to link to the already-built turtl_core # library and used to do so automatically, however this does not work # anymore. Upstream bug or deprecated funtionality in Rust? @@ -60,6 +54,23 @@ check() { # containing turtl_core.so to allow the dynamic linking to occur. export LD_LIBRARY_PATH="${srcdir}/core-rs-${_commithash}/target/release:${LD_LIBRARY_PATH}" + # Determine the capabilities of the terminal this script is running in + reset="$(tput sgr0 2> /dev/null)" + if [ "$?" -eq 0 ]; then + bold="$(tput bold 2> /dev/null)" + + numColours="$(tput colors)" + if [ "$numColours" -ge 8 ]; then + blue="$(tput setaf 4)" + fi + fi + + # Echoes a blue arrow followed by a bolded log message, much like the + # verbose printing that makepkg itself does + log() { + echo -e "${reset} ${bold}${blue}->${reset} ${bold}$@${reset}" + } + # Create the directories for the PostgreSQL database cluster, Turtl server # copy and Turtl server upload contents. Copy the core-rs and server # configuration files, initialize the database cluster and start a |