"Fossies" - the Fresh Open Source Software Archive

Member "ncompress-5.0/travis/lib.sh" (2 Feb 2021, 620 Bytes) of package /linux/privat/ncompress-5.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 # Common funcs for working w/Travis.
    3 
    4 travis_fold() {
    5     if [[ -n ${TRAVIS_OS_NAME} ]] ; then
    6         printf 'travis_fold:%s:%s\r\n' "$@" | sed 's: :_:g'
    7     fi
    8 }
    9 
   10 if [[ -n ${TRAVIS_OS_NAME} ]] ; then
   11     whitebg=$(tput setab 7)
   12     blackfg=$(tput setaf 0)
   13     normal=$(tput sgr0)
   14 else
   15     whitebg=
   16     blackbg=
   17     normal=
   18 fi
   19 v() {
   20     local fold=""
   21     case $1 in
   22     --fold=*) fold=${1:7}; shift;;
   23     esac
   24     if [[ -n ${fold} ]] ; then
   25         travis_fold start "${fold}"
   26         echo "\$ $*"
   27         "$@"
   28         travis_fold end "${fold}"
   29     else
   30         echo "${whitebg}${blackfg}\$ $*${normal}"
   31         "$@"
   32     fi
   33 }
   34 
   35 ncpus=$(getconf _NPROCESSORS_ONLN)
   36 m() {
   37     v make -j${ncpus} "$@"
   38 }