sequencer - correct indentation using .editorconfig
This commit is contained in:
@@ -89,7 +89,7 @@ Usage: $SEQ_NAME [OPTIONS] [STEP NUMBER(s) or ALIAS] [STEP ARGUMENTS]
|
||||
--version : Display version of sequencer and revision of sequence
|
||||
-- : End options marker
|
||||
++ : Quick start step 1 (-qq) and skipping [STEP NUMBER(s) or ALIAS]
|
||||
|
||||
|
||||
[STEP NUMBER"(s)" 1-${MAX_STEP} or ALIAS]
|
||||
No STEP or ALIAS : assume 1 as starting point
|
||||
Single STEP or ALIAS : starting point of sequential process
|
||||
@@ -144,15 +144,15 @@ sequencer.sh global variables:
|
||||
|
||||
sequencer.sh build-in functions:
|
||||
USAGE_API
|
||||
echo -e "${GREEN} exe [COMMANDLINE]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} exe [COMMANDLINE]${NC}"
|
||||
cat <<USAGE_API
|
||||
Execute command line without pipes or redirects (>,<,|).
|
||||
Supporting: dry-run (-d): only print command without execution
|
||||
verbose (-v): print command before execution
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} exep \"[COMMAND STRING(s)]\"${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} exep \"[COMMAND STRING(s)]\"${NC}"
|
||||
cat <<USAGE_API
|
||||
See exe, but support for pipes or redirects.
|
||||
e.g.: exep echo hello world \\> \\'out put.log\\'
|
||||
exep echo hello world \\> out\\\\ put.log
|
||||
@@ -163,14 +163,14 @@ cat <<USAGE_API
|
||||
- All apostrophes need to be esacped since the command line is given as string.
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} escpath <PATH>${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} escpath <PATH>${NC}"
|
||||
cat <<USAGE_API
|
||||
Escaping non-printable characters with the proposed POSIX $'' syntax
|
||||
e.g. \$(escpath /my own/ho me/path) = $(escpath /my own/ho me/path)
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} initSeqConfig [OPTION] <NAME> [TEMPLATE]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} initSeqConfig [OPTION] <NAME> [TEMPLATE]${NC}"
|
||||
cat <<USAGE_API
|
||||
Create a configuration file in $SEQ_CONFIG_HOME/ and source it if already existent.
|
||||
[OPTION]
|
||||
-p : Use profiles
|
||||
@@ -184,8 +184,8 @@ cat <<USAGE_API
|
||||
3 : No configuration created
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} addConf <OPTIONS> [SOURCE TYPE] <SOURCE> <DESTINATION FILE>${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} addConf <OPTIONS> [SOURCE TYPE] <SOURCE> <DESTINATION FILE>${NC}"
|
||||
cat <<USAGE_API
|
||||
Trying to write or append text or a file (<SOURCE>) to a destination file.
|
||||
If the CONFIGFILE exists, a backup (name_%Y%m%d-%H%M%S.bck) is saved at the same location.
|
||||
If -s fails or -m, "$(realpath "$MISSING_CONF")" is created with the conflicts
|
||||
@@ -203,65 +203,65 @@ cat <<USAGE_API
|
||||
Target file to be created or modified.
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} step <STEP NUMBER OR ALIAS>${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} step <STEP NUMBER OR ALIAS>${NC}"
|
||||
cat <<USAGE_API
|
||||
Executes a single step also by alias. Useful if step numbers get reorganized.
|
||||
dry-run is not applied in this function! The executed step is responsible.
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} outColor [FOREGROUND COLOR] [BACKGROUND COLOR]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} outColor [FOREGROUND COLOR] [BACKGROUND COLOR]${NC}"
|
||||
cat <<USAGE_API
|
||||
Set output color permanently until reset.
|
||||
No argument or unknown foreground color restores shell default (reset).
|
||||
Color reset happens after every step and step_info function call.
|
||||
[COLOR]: black, red, green, yellow, blue, magenta, cyan, white
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} echoerr [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} echoerr [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo to stderr
|
||||
[...] : all parameter are forwarded to echo
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} echoseq [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} echoseq [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo to stdout if sequencer output is not suppressed
|
||||
[...] : all parameter are forwarded to echo
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} echoinfo [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} echoinfo [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo additional correctly indented line to step info
|
||||
[...] : all parameter are forwared to echo
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} echoinfoArgs [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} echoinfoArgs [...]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo argument description after step number or alias.
|
||||
This must be called first in the step info function.
|
||||
Does not add a newline at the end.
|
||||
[...] : no parameter are forwared to echo
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} endCheckEmpty <VARIABLENAME> [DESCRIPTION]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} endCheckEmpty <VARIABLENAME> [DESCRIPTION]${NC}"
|
||||
cat <<USAGE_API
|
||||
exit 666 if variable is empty
|
||||
<VARIABLENAME> : Name used within eval
|
||||
[DESCRIPTION] : Additional text for error output
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} saveReturn [ERRORCODE]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} saveReturn [ERRORCODE]${NC}"
|
||||
cat <<USAGE_API
|
||||
Save ERRORCODE if it is != 0 for later use with endReturn
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} getReturn${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} getReturn${NC}"
|
||||
cat <<USAGE_API
|
||||
Return last saved error code
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} endReturn [OPTIONS] [MESSAGE]${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} endReturn [OPTIONS] [MESSAGE]${NC}"
|
||||
cat <<USAGE_API
|
||||
Notifys user that there was an error (previously saved by saveReturn,
|
||||
or -o [ERRORCODE]) and asks to continue or end the sequence.
|
||||
Always exits with evaluated error code.
|
||||
@@ -272,8 +272,8 @@ cat <<USAGE_API
|
||||
String which is displayed in the error output
|
||||
|
||||
USAGE_API
|
||||
echo -e "${GREEN} exitIfRunning${NC}"
|
||||
cat <<USAGE_API
|
||||
echo -e "${GREEN} exitIfRunning${NC}"
|
||||
cat <<USAGE_API
|
||||
End sequence if an instance of it is still running
|
||||
|
||||
USAGE_API
|
||||
@@ -281,10 +281,10 @@ USAGE_API
|
||||
|
||||
# check if there is another PID other than this one
|
||||
exitIfRunning() {
|
||||
if pidof -o %PPID -x "${0##*/}">>/dev/null; then
|
||||
echoseq " [E] Sequence already running"
|
||||
exit 1
|
||||
fi
|
||||
if pidof -o %PPID -x "${0##*/}">>/dev/null; then
|
||||
echoseq " [E] Sequence already running"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Echo only if not -qq ($QUIET -ne 2)
|
||||
@@ -320,7 +320,7 @@ outColor() {
|
||||
*)
|
||||
tput setaf $1;;
|
||||
esac
|
||||
|
||||
|
||||
case "$2" in
|
||||
black)
|
||||
tput setab 0;;
|
||||
@@ -491,7 +491,7 @@ listProfiles() {
|
||||
echo ${file%.*}
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# initSeqConfig [OPTION] <NAME> [TEMPLATE]
|
||||
# Create a configuration file in the users' home.
|
||||
# Source it if already existent
|
||||
@@ -543,7 +543,7 @@ initSeqConfig() {
|
||||
echoseq -n " [I] Creating $(realpath $configDir)..."
|
||||
exe install -m 700 -d "$configDir" && echoseq "Ok" || echoseq "Nok"
|
||||
fi
|
||||
|
||||
|
||||
SEQ_CONFIG_HOME="$configDir"
|
||||
|
||||
if [ -s "$configLoc" ] ; then
|
||||
@@ -568,7 +568,7 @@ initSeqConfig() {
|
||||
|
||||
# Config does not exist, check for template
|
||||
if [ -s "$configTemplate" ] ; then
|
||||
|
||||
|
||||
# Check first if there is an existing configuration at the templates position
|
||||
local configExists="$(dirname $configTemplate)/$1"
|
||||
if [ -s "$configExists" ] ; then
|
||||
@@ -668,7 +668,7 @@ addConf() {
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
local source="$1"
|
||||
local dest="$2"
|
||||
|
||||
@@ -725,7 +725,7 @@ addConf() {
|
||||
echo -n "### " >> "$MISSING_CONF"
|
||||
date >> "$MISSING_CONF"
|
||||
fi
|
||||
|
||||
|
||||
local helpText="needs to be added manually"
|
||||
if [ "$confMode" == "-s" ] ; then
|
||||
helpText="not overwritten"
|
||||
@@ -904,7 +904,7 @@ selection() {
|
||||
local selection_array=("$@")
|
||||
|
||||
[ ${#selection_array[@]} -eq 0 ] && return 1
|
||||
|
||||
|
||||
echoseq " [I] Starting sequence $(realpath $0) ..."
|
||||
|
||||
for selection_i in ${selection_array[@]} ; do
|
||||
@@ -943,10 +943,10 @@ step_config() {
|
||||
## Called once before executing steps.
|
||||
## e.g. to source a config file manually:
|
||||
#. "\$CONFIG_FILE"
|
||||
|
||||
|
||||
## or to use sequencer api with profile config file support:
|
||||
#initSeqConfig -p "\$SCRIPT_NAME" "\$CONFIG_FILE_TEMPLATE"
|
||||
|
||||
|
||||
## or to use sequencer api with global config file:
|
||||
#initSeqConfig "\$CONFIG_FILE_NAME" "\$CONFIG_FILE_TEMPLATE"
|
||||
#if [ \$? -eq 0 ] ; then
|
||||
@@ -1173,7 +1173,7 @@ exe() {
|
||||
if [ $DRY -ne 0 ] || [ $VERBOSE -eq 1 ] ; then
|
||||
(set -x; : "$@")
|
||||
fi
|
||||
|
||||
|
||||
if [ $DRY -eq 0 ] ; then
|
||||
"$@"
|
||||
fi
|
||||
@@ -1267,7 +1267,7 @@ main() {
|
||||
exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
# Don't show help if only configuration should be edited
|
||||
[ $SEQ_CONFIG_EDIT -ne 0 ] && [ -z "$1" ] && QUIET=2
|
||||
|
||||
@@ -1357,7 +1357,7 @@ main() {
|
||||
echoerr " [E] Sequence does not have a configuration file"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Check for profile support
|
||||
if [ $SEQ_PROFILE_LIST -ne 0 ]; then
|
||||
listProfiles; exit $?
|
||||
|
Reference in New Issue
Block a user