Sha256: 5b6c08d746b990f9970bf73db63b68aa0cde021356a473ef884e7d86fef7dd64

Contents?: true

Size: 712 Bytes

Versions: 3

Compression:

Stored size: 712 Bytes

Contents

shellject ()
{
  local executable output shellject_exit eval_exit
  executable=$( type -P shellject );
  if [[ "$executable" == "" ]]; then
    >&2 echo "shellject executable does not seem to exist."
    >&2 echo "Make sure shellject gem is installed correctly for $(ruby -v)"
    return 1
  fi
  output=$( $executable $@ );
  shellject_exit=$?;
  if [[ $shellject_exit == 0 && "$1" == "load" && ! ($@ =~ "--help" || $@ =~ " -h") ]]; then
    eval "$output";
    eval_exit=$?
    if [[ $eval_exit != 0 ]]; then
      echo "Loading shelljection $2 FAILED";
      return $eval_exit;
    fi;
  else
    if [[ $shellject_exit == 0 ]]; then
      echo "$output";
    else
      return $shellject_exit;
    fi;
  fi
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shellject-1.0.2 bash/shellject_wrapper.sh
shellject-1.0.1 bash/shellject_wrapper.sh
shellject-0.3.0 bash/shellject_wrapper.sh