/ commenting out debug info
This commit is contained in:
@@ -17,18 +17,18 @@ sync_dir=${!syncdir_env_var} # '!' to use the name and not the value
|
||||
cwd=$(pwd)
|
||||
callback=$1
|
||||
|
||||
echo
|
||||
echo ">>> ${this_file_name} <<<"
|
||||
echo
|
||||
echo "DEBUG: debugging values:"
|
||||
echo "DEBUG: input args (all): $@"
|
||||
echo "DEBUG: input args (one by one):"
|
||||
for i in "$@"; do echo "DEBUG: $i"; done;
|
||||
echo "DEBUG: sync_dir_sym: ${sync_dir_sym}"
|
||||
echo "DEBUG: sync_dir: ${sync_dir}"
|
||||
echo "DEBUG: cwd: ${cwd}"
|
||||
echo "DEBUG: callback: ${callback}"
|
||||
echo
|
||||
# echo
|
||||
# echo ">>> ${this_file_name} <<<"
|
||||
# echo
|
||||
# echo "DEBUG: debugging values:"
|
||||
# echo "DEBUG: input args (all): $@"
|
||||
# echo "DEBUG: input args (one by one):"
|
||||
# for i in "$@"; do echo "DEBUG: $i"; done;
|
||||
# echo "DEBUG: sync_dir_sym: ${sync_dir_sym}"
|
||||
# echo "DEBUG: sync_dir: ${sync_dir}"
|
||||
# echo "DEBUG: cwd: ${cwd}"
|
||||
# echo "DEBUG: callback: ${callback}"
|
||||
# echo
|
||||
|
||||
# remove the first element (the callback) from $@
|
||||
# https://stackoverflow.com/questions/2701400/remove-first-element-from-in-bash
|
||||
@@ -39,10 +39,10 @@ shift
|
||||
indexA=0
|
||||
for input_file in "${@}"; do
|
||||
indexA=$((indexA+1))
|
||||
echo "- - - - - - - - - -"
|
||||
echo "DEBUG [indexA]: ${indexA}"
|
||||
echo "DEBUG [\$@]: $@"
|
||||
echo "DEBUG [input_file]: ${input_file[@]}"
|
||||
# echo "- - - - - - - - - -"
|
||||
# echo "DEBUG [indexA]: ${indexA}"
|
||||
# echo "DEBUG [\$@]: $@"
|
||||
# echo "DEBUG [input_file]: ${input_file[@]}"
|
||||
|
||||
# lf file manager sends multiple files as one input parameter, split by with newlines
|
||||
# https://superuser.com/questions/284187/bash-iterating-over-lines-in-a-variable
|
||||
@@ -54,14 +54,14 @@ for input_file in "${@}"; do
|
||||
theArray+=("$arrayLine")
|
||||
done <<< "$input_file"
|
||||
|
||||
echo "DEBUG [theArray]: ${theArray[@]}"
|
||||
# echo "DEBUG [theArray]: ${theArray[@]}"
|
||||
|
||||
indexB=0
|
||||
for line in "${theArray[@]}"
|
||||
do
|
||||
indexB=$((indexB+1))
|
||||
echo " DEBUG [indexB]: ${indexB}"
|
||||
echo " DEBUG [line]: ${line}"
|
||||
# echo " DEBUG [indexB]: ${indexB}"
|
||||
# echo " DEBUG [line]: ${line}"
|
||||
|
||||
# if input file has no path specified
|
||||
if [[ ${line} != *"/"* ]]; then
|
||||
@@ -75,7 +75,7 @@ for input_file in "${@}"; do
|
||||
new_file=${line//$sync_dir_sym/$sync_dir}
|
||||
|
||||
if [[ -f "${new_file}" ]] || [[ -d "${new_file}" ]] ; then
|
||||
echo " DEBUG: executing '${callback} ${new_file}'"
|
||||
echo "${callback} ${new_file}"
|
||||
${callback} ${new_file}
|
||||
else
|
||||
echo "ERROR: file not found: \"${new_file}\""
|
||||
|
||||
Reference in New Issue
Block a user