From 350080fcff0de012f5eef7e8bd3502914f970764 Mon Sep 17 00:00:00 2001 From: Nathaniel Landau Date: Sat, 31 Dec 2016 09:36:34 -0500 Subject: [PATCH] fixed function --- lib/sharedFunctions.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/sharedFunctions.sh b/lib/sharedFunctions.sh index 59e8b9e..681c685 100644 --- a/lib/sharedFunctions.sh +++ b/lib/sharedFunctions.sh @@ -332,7 +332,6 @@ function unmountDrive() { # text is available in the script they will be printed # in the '$usage' variable. # ------------------------------------------------------ - function help () { echo "" 1>&2 input " $@" 1>&2 @@ -351,7 +350,6 @@ function help () { # manager 'Homebrew'. # Usage in script: $ homebrewDependencies=(package1 package2) # ----------------------------------- - function checkDependencies() { saveIFS=$IFS IFS=$' \n\t' @@ -383,13 +381,10 @@ function checkDependencies() { IFS=$saveIFS } -# pauseScript -# ----------------------------------- -# A simple function used to pause a script at any point and -# only continue on user input -# ----------------------------------- function pauseScript() { + # A simple function used to pause a script at any point and + # only continue on user input seek_confirmation "Ready to continue?" if is_confirmed; then info "Continuing" @@ -401,7 +396,7 @@ function pauseScript() { function in_array() { # Determine if a value is in an array. - # Usage: in_array [VALUE] [ARRAY] + # Usage: if in_array "VALUE" "${ARRAY[@]}"; then ... local value="$1"; shift for arrayItem in "$@"; do [[ "${arrayItem}" == "${value}" ]] && return 0 @@ -470,7 +465,6 @@ squeeze_lines() { sed '/^[[:space:]]\+$/s/.*//g' | cat -s | trim_lines } - progressBar() { # progressBar # ----------------------------------- @@ -544,7 +538,6 @@ htmlEncode() { echo "${1}" | sed -f "${SOURCEPATH}/htmlEncode.sed" } - urlencode() { # URL encoding/decoding from: https://gist.github.com/cdown/1163649 # Usage: urlencode @@ -745,7 +738,7 @@ function writeCSV() { } -function json2yaml { +function json2yaml() { # convert json files to yaml using python and PyYAML python -c 'import sys, yaml, json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < "$1" }