From 992868b14da935a12092f19dd4c6bd3f2955bfe0 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Mon, 14 Mar 2022 21:31:53 +0100 Subject: [PATCH] sequencer - correct indentation using .editorconfig --- sequencer/sequencer.sh | 98 +++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/sequencer/sequencer.sh b/sequencer/sequencer.sh index ff83675..673591e 100755 --- a/sequencer/sequencer.sh +++ b/sequencer/sequencer.sh @@ -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 <,<,|). 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 < \\'out put.log\\' exep echo hello world \\> out\\\\ put.log @@ -163,14 +163,14 @@ cat <${NC}" -cat <${NC}" + cat < [TEMPLATE]${NC}" -cat < [TEMPLATE]${NC}" + cat < [SOURCE TYPE] ${NC}" -cat < [SOURCE TYPE] ${NC}" + cat <) 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 <${NC}" -cat <${NC}" + cat < [DESCRIPTION]${NC}" -cat < [DESCRIPTION]${NC}" + cat < : Name used within eval [DESCRIPTION] : Additional text for error output USAGE_API -echo -e "${GREEN} saveReturn [ERRORCODE]${NC}" -cat <>/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] [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 $?