?login_element?

Subversion Repositories NedoOS

Rev

Rev 129 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #!/usr/bin/env bash
  2.  
  3. # $1 = EXE_NAME, $2 = PROJECT_DIR, result is set into global $EXE
  4. function find_newest_binary() {
  5.     # find the most fresh executable
  6.     for P1EXT in "$1"{,".exe"}; do
  7.         command -v "$P1EXT" >/dev/null 2>&1 && EXE="$P1EXT" # system installed executable
  8.         local EXE_MAKE="$2/$P1EXT"
  9.         [[ -f "$EXE_MAKE" && "$EXE_MAKE" -nt "$EXE" ]] && EXE=$EXE_MAKE
  10.         local EXE_CMAKE="$2/build/$P1EXT"
  11.         [[ -f "$EXE_CMAKE" && "$EXE_CMAKE" -nt "$EXE" ]] && EXE=$EXE_CMAKE
  12.     done
  13. }
  14.  
  15. # "decolorize" output if NOCOLOR is set to anything non-empty
  16. [[ -n "$NOCOLOR" ]] && function echo() {
  17.     command echo "$@" | sed -e 's/\x1b\[[0-9]\+m//g'
  18. }
  19.  
  20. function pushd () {
  21.     command pushd "$@" > /dev/null
  22. }
  23.  
  24. function popd () {
  25.     command popd "$@" > /dev/null
  26. }
  27.