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