Sha256: 0c19e8bed7ce66fa54a66b9ec1ad9ef47c58deeb04a9cb0a08521756fce3fa39

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 KB

Contents

#!/bin/bash

: ${__meat__:=x}
if [[ "$__meat__" != 'x' ]]; then
  return 0
fi
__meat__='y'

function check_help {
  # taken from shocco
  if expr -- "$*" : ".*--help" >/dev/null; then
    display_help
    exit 0
  fi
}

function display_help {
  # taken from shocco
  grep '^#/' <"$shome/bin/$(basename -- "$0")" | cut -c4-
}

function which_library {
  local library="$1"; shift
  echo "$shome/bin/_$library"
}

function require {
  source "$(which_library "$@")"
}

function parse_command_line {
  if ! FLAGS "$@"; then
    if [[ "$flags_error" = "help requested" ]]; then
      echo ""
      display_help
      exit 0
    fi
    
    return 4
  fi
  return 0
}

function configure_logging {
  # load log4sh (disabling properties file warning) and clear the default
  # configuration
  LOG4SH_CONFIGURATION='none' require 'log4sh'
  log4sh_resetConfiguration

  # set the global logging level to INFO
  logger_setLevel INFO

  # add and configure a FileAppender that outputs to STDERR, and activate the
  # configuration
  logger_addAppender stderr
  appender_setType stderr FileAppender
  appender_file_setFile stderr STDERR
  appender_activateOptions stderr
}

function _main {
  if [[ "$0" = "-bash" ]]; then
    echo 'ERROR: cannot source library without setting $shome'
    exit 1
  fi

  if [[ -z "$shome" ]]; then
    shome="$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)"
  fi

  require 'shflags'

  configure_logging
  
  PATH="$shome/bin:$PATH"
}

_main "$@"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
HeSYINUvSBZfxqA-capistrano-2.5.28 bin/_meat
HeSYINUvSBZfxqA-capistrano-2.5.27 bin/_meat
HeSYINUvSBZfxqA-capistrano-2.5.26 bin/_meat
HeSYINUvSBZfxqA-capistrano-2.5.25 bin/_meat
HeSYINUvSBZfxqA-capistrano-2.5.24 bin/_meat