Sha256: 773f09f21c5d56580176ab573fdb4f513ed47bef66e9b7ae81711740607d70c8

Contents?: true

Size: 1.6 KB

Versions: 48

Compression:

Stored size: 1.6 KB

Contents

#!/bin/bash
#
# load.sh
#
#-------------------------------------------------------------------------------
# Shared functions

#-------------------------------------------------------------------------------
# Get the directory of the command passed via the first parameter.
#
# USAGE:> SCRIPT_DIR=`get_command_location $0`
#
function get_command_location()
{
    local SCRIPT_DIR="$(cd "$(dirname "$([ `readlink "$1"` ] && echo "`readlink "$1"`" || echo "$1")")"; pwd -P)"
    
    # Return the final directory found. 
    echo "$SCRIPT_DIR"
    return 0
}

#-------------------------------------------------------------------------------
# Initialization

if [ ! -d "$SHELL_LIB_DIR" ]
then
	SHELL_LIB_DIR=`get_command_location $0`
fi

#-------------------------------------------------------------------------------

# Load command utilities.  This should always be loaded first.
COMMON_COMMAND="$SHELL_LIB_DIR/command.sh"

if [ -f "$COMMON_COMMAND" ]
then
	source "$COMMON_COMMAND"
fi

# Load os utilities.
COMMON_OS="$SHELL_LIB_DIR/os.sh"

if [ -f "$COMMON_OS" ]
then
    source "$COMMON_OS"
    os_info
fi

# Load file system utilities.
COMMON_FILESYSTEM="$SHELL_LIB_DIR/filesystem.sh"

if [ -f "$COMMON_FILESYSTEM" ]
then
	source "$COMMON_FILESYSTEM"
fi

# Load script utilities.
COMMON_SCRIPT="$SHELL_LIB_DIR/script.sh"

if [ -f "$COMMON_SCRIPT" ]
then
	source "$COMMON_SCRIPT"
fi

#-------------------------------------------------------------------------------

# Load any validators used in parse_option() calls.
COMMON_VALIDATORS="$SHELL_LIB_DIR/validators.sh"

if [ -f "$COMMON_VALIDATORS" ]
then
	source "$COMMON_VALIDATORS"
fi

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
corl-0.5.18 bootstrap/lib/shell/load.sh
corl-0.5.17 bootstrap/lib/shell/load.sh
corl-0.5.16 bootstrap/lib/shell/load.sh
corl-0.5.15 bootstrap/lib/shell/load.sh
corl-0.5.14 bootstrap/lib/shell/load.sh
corl-0.5.13 bootstrap/lib/shell/load.sh
corl-0.5.12 bootstrap/lib/shell/load.sh
corl-0.5.11 bootstrap/lib/shell/load.sh
corl-0.5.10 bootstrap/lib/shell/load.sh
corl-0.5.9 bootstrap/lib/shell/load.sh
corl-0.5.8 bootstrap/lib/shell/load.sh
corl-0.5.7 bootstrap/lib/shell/load.sh
corl-0.5.6 bootstrap/lib/shell/load.sh
corl-0.5.5 bootstrap/lib/shell/load.sh
corl-0.5.4 bootstrap/lib/shell/load.sh
corl-0.5.3 bootstrap/lib/shell/load.sh
corl-0.5.2 bootstrap/lib/shell/load.sh
corl-0.5.1 bootstrap/lib/shell/load.sh
corl-0.5.0 bootstrap/lib/shell/load.sh
corl-0.4.29 bootstrap/lib/shell/load.sh