mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-10 06:03:47 -05:00
fix spelling errors
This commit is contained in:
@@ -10,7 +10,7 @@ _mainScript_() {
|
|||||||
# ARGS: $1 (Required) - File to check
|
# ARGS: $1 (Required) - File to check
|
||||||
# OUTS: None
|
# OUTS: None
|
||||||
# USAGE: Call the function
|
# USAGE: Call the function
|
||||||
# NOTE: Requires a file localed at `~/.git_stop_words` containing one word per line.
|
# NOTE: Requires a file located at `~/.git_stop_words` containing one word per line.
|
||||||
|
|
||||||
# Fail if any matching words are present in the diff
|
# Fail if any matching words are present in the diff
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ _mainScript_() {
|
|||||||
success "yamllint passed: '${1}'"
|
success "yamllint passed: '${1}'"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
notice "No YAML linter installed. Continuiing..."
|
notice "No YAML linter installed. Continuing..."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ Common utilities for working with files.
|
|||||||
* `_extract_` Extract a compressed file
|
* `_extract_` Extract a compressed file
|
||||||
* `_json2yaml_` Convert JSON to YAML uses python
|
* `_json2yaml_` Convert JSON to YAML uses python
|
||||||
* `_makeSymlink_` Creates a symlink and backs up a file which may be overwritten by the new symlink. If the exact same symlink already exists, nothing is done.
|
* `_makeSymlink_` Creates a symlink and backs up a file which may be overwritten by the new symlink. If the exact same symlink already exists, nothing is done.
|
||||||
* `_parseYAML_` Convert a YANML file into BASH variables for use in a shell script
|
* `_parseYAML_` Convert a YAML file into BASH variables for use in a shell script
|
||||||
* `_readFile_` Prints each line of a file
|
* `_readFile_` Prints each line of a file
|
||||||
* `_sourceFile_` Source a file into a script
|
* `_sourceFile_` Source a file into a script
|
||||||
* `_uniqueFileName_` Ensure a file to be created has a unique filename to avoid overwriting other files
|
* `_uniqueFileName_` Ensure a file to be created has a unique filename to avoid overwriting other files
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ setup() {
|
|||||||
|
|
||||||
pushd "${TESTDIR}" >&2
|
pushd "${TESTDIR}" >&2
|
||||||
|
|
||||||
######## DEFAUL FLAGS ########
|
######## DEFAULT FLAGS ########
|
||||||
LOGFILE="${TESTDIR}/logs/log.txt"
|
LOGFILE="${TESTDIR}/logs/log.txt"
|
||||||
QUIET=false
|
QUIET=false
|
||||||
LOGLEVEL=ERROR
|
LOGLEVEL=ERROR
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ setup() {
|
|||||||
B=(1 2 3 4 5 6)
|
B=(1 2 3 4 5 6)
|
||||||
DUPES=(1 2 3 1 2 3)
|
DUPES=(1 2 3 1 2 3)
|
||||||
|
|
||||||
######## DEFAUL FLAGS ########
|
######## DEFAULT FLAGS ########
|
||||||
LOGFILE="${TESTDIR}/logs/log.txt"
|
LOGFILE="${TESTDIR}/logs/log.txt"
|
||||||
QUIET=false
|
QUIET=false
|
||||||
LOGLEVEL=ERROR
|
LOGLEVEL=ERROR
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ setup() {
|
|||||||
|
|
||||||
pushd "${TESTDIR}" >&2
|
pushd "${TESTDIR}" >&2
|
||||||
|
|
||||||
######## DEFAUL FLAGS ########
|
######## DEFAULT FLAGS ########
|
||||||
LOGFILE="${TESTDIR}/logs/log.txt"
|
LOGFILE="${TESTDIR}/logs/log.txt"
|
||||||
QUIET=false
|
QUIET=false
|
||||||
LOGLEVEL=ERROR
|
LOGLEVEL=ERROR
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ fi
|
|||||||
setup() {
|
setup() {
|
||||||
|
|
||||||
TESTDIR="$(temp_make)"
|
TESTDIR="$(temp_make)"
|
||||||
######## DEFAUL FLAGS ########
|
######## DEFAULT FLAGS ########
|
||||||
LOGFILE="${TESTDIR}/logs/log.txt"
|
LOGFILE="${TESTDIR}/logs/log.txt"
|
||||||
QUIET=false
|
QUIET=false
|
||||||
LOGLEVEL=OFF
|
LOGLEVEL=OFF
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ setup() {
|
|||||||
|
|
||||||
pushd "${TESTDIR}" &>/dev/null
|
pushd "${TESTDIR}" &>/dev/null
|
||||||
|
|
||||||
######## DEFAUL FLAGS ########
|
######## DEFAULT FLAGS ########
|
||||||
LOGFILE="${TESTDIR}/logs/log.txt"
|
LOGFILE="${TESTDIR}/logs/log.txt"
|
||||||
QUIET=false
|
QUIET=false
|
||||||
LOGLEVEL=OFF
|
LOGLEVEL=OFF
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ setup() {
|
|||||||
|
|
||||||
pushd "${TESTDIR}" &>/dev/null
|
pushd "${TESTDIR}" &>/dev/null
|
||||||
|
|
||||||
######## DEFAUL FLAGS ########
|
######## DEFAULT FLAGS ########
|
||||||
LOGFILE="${TESTDIR}/logs/log.txt"
|
LOGFILE="${TESTDIR}/logs/log.txt"
|
||||||
QUIET=false
|
QUIET=false
|
||||||
LOGLEVEL=OFF
|
LOGLEVEL=OFF
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ setup() {
|
|||||||
|
|
||||||
pushd "${TESTDIR}" &>/dev/null
|
pushd "${TESTDIR}" &>/dev/null
|
||||||
|
|
||||||
######## DEFAUL FLAGS ########
|
######## DEFAULT FLAGS ########
|
||||||
LOGFILE="${TESTDIR}/logs/log.txt"
|
LOGFILE="${TESTDIR}/logs/log.txt"
|
||||||
QUIET=false
|
QUIET=false
|
||||||
LOGLEVEL=OFF
|
LOGLEVEL=OFF
|
||||||
@@ -93,13 +93,13 @@ _testCleanString_() {
|
|||||||
assert_output "I AM IN CAPS"
|
assert_output "I AM IN CAPS"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "_cleanString_: remove spaces before/aftrer dashes" {
|
@test "_cleanString_: remove spaces before/after dashes" {
|
||||||
run _cleanString_ "word - another- word -another-word"
|
run _cleanString_ "word - another- word -another-word"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "word-another-word-another-word"
|
assert_output "word-another-word-another-word"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "_cleanString_: remove spaces before/aftrer underscores" {
|
@test "_cleanString_: remove spaces before/after underscores" {
|
||||||
run _cleanString_ "word _ another_ word _another_word"
|
run _cleanString_ "word _ another_ word _another_word"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "word_another_word_another_word"
|
assert_output "word_another_word_another_word"
|
||||||
@@ -173,9 +173,9 @@ _testStopWords_() {
|
|||||||
_testStopWords_
|
_testStopWords_
|
||||||
|
|
||||||
@test "_escape_" {
|
@test "_escape_" {
|
||||||
run _escape_ "Here is some / text to & be - escape'd"
|
run _escape_ "Here is some / text to & be - escaped"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "Here\ is\ some\ /\ text\ to\ &\ be\ -\ escape'd"
|
assert_output "Here\ is\ some\ /\ text\ to\ &\ be\ -\ escaped"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "_htmlEncode_" {
|
@test "_htmlEncode_" {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ _execute_() {
|
|||||||
# ARGS: $1 (Required) - The command to be executed. Quotation marks MUST be escaped.
|
# ARGS: $1 (Required) - The command to be executed. Quotation marks MUST be escaped.
|
||||||
# $2 (Optional) - String to display after command is executed
|
# $2 (Optional) - String to display after command is executed
|
||||||
# OPTS: -v Always print debug output from the execute function
|
# OPTS: -v Always print debug output from the execute function
|
||||||
# -p Pass a failed command with 'return 0'. This effecively bypasses set -e.
|
# -p Pass a failed command with 'return 0'. This effectively bypasses set -e.
|
||||||
# -e Bypass _alert_ functions and use 'echo RESULT'
|
# -e Bypass _alert_ functions and use 'echo RESULT'
|
||||||
# -s Use '_alert_ success' for successful output. (default is 'info')
|
# -s Use '_alert_ success' for successful output. (default is 'info')
|
||||||
# -q Do not print output (QUIET mode)
|
# -q Do not print output (QUIET mode)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ _listFiles_() {
|
|||||||
# NOTE: Searches are NOT case sensitive and MUST be quoted
|
# NOTE: Searches are NOT case sensitive and MUST be quoted
|
||||||
# USAGE: _listFiles_ glob "*.txt" "some/backup/dir"
|
# USAGE: _listFiles_ glob "*.txt" "some/backup/dir"
|
||||||
# _listFiles_ regex ".*\.txt" "some/backup/dir"
|
# _listFiles_ regex ".*\.txt" "some/backup/dir"
|
||||||
# readarry -t array < <(_listFiles_ g "*.txt")
|
# readarray -t array < <(_listFiles_ g "*.txt")
|
||||||
|
|
||||||
[[ $# -lt 2 ]] && {
|
[[ $# -lt 2 ]] && {
|
||||||
error 'Missing required argument to _listFiles_()!'
|
error 'Missing required argument to _listFiles_()!'
|
||||||
@@ -446,7 +446,7 @@ _makeSymlink_() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_parseYAML_() {
|
_parseYAML_() {
|
||||||
# DESC: Convert a YANML file into BASH variables for use in a shell script
|
# DESC: Convert a YAML file into BASH variables for use in a shell script
|
||||||
# ARGS: $1 (Required) - Source YAML file
|
# ARGS: $1 (Required) - Source YAML file
|
||||||
# $2 (Required) - Prefix for the variables to avoid namespace collisions
|
# $2 (Required) - Prefix for the variables to avoid namespace collisions
|
||||||
# OUTS: Prints variables and arrays derived from YAML File
|
# OUTS: Prints variables and arrays derived from YAML File
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ _cleanString_() {
|
|||||||
# - leading white space
|
# - leading white space
|
||||||
# - trailing white space
|
# - trailing white space
|
||||||
# - multiple spaces become a single space
|
# - multiple spaces become a single space
|
||||||
# - remove spaces before and aftrer -_
|
# - remove spaces before and after -_
|
||||||
|
|
||||||
local opt
|
local opt
|
||||||
local lc=false
|
local lc=false
|
||||||
|
|||||||
Reference in New Issue
Block a user