From 3869dd587d38593ff9b437d21bc36a94d74b0a10 Mon Sep 17 00:00:00 2001 From: "committer@tuxwarrior" Date: Sat, 12 Apr 2025 15:41:54 -0500 Subject: [PATCH] / removal of old code --- dots/bin/tp.sh | 66 -------------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/dots/bin/tp.sh b/dots/bin/tp.sh index 2e7f963..a14a44e 100755 --- a/dots/bin/tp.sh +++ b/dots/bin/tp.sh @@ -10,69 +10,3 @@ if [ $# -lt 1 ]; then fi lfMultiSelectHandler.sh trash-put $@ - -exit 0 - -sync_dir_sym=/home/${USER}/syncDir -syncdir_env_var=SYNCDIR_${HOSTNAME} -sync_dir=${!syncdir_env_var} # '!' to use the name and not the value -cwd=$(pwd) - -# nifty for debugging: -log_file="/home/poq/syncDir/0_downloads/tp.log" -#echo -#echo "debugging values:" -#echo "input args: $@" -#for i in "$@"; do echo " $i"; done; -#echo "sync_dir_sym: ${sync_dir_sym}" -#echo "sync_dir: ${sync_dir}" -#echo "cwd: ${cwd}" -#echo -#echo "---" >> ${log_file} -#echo "$@" >> ${log_file} - -# loop through all files to delete -for input_file in "$@"; do - - # 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 - declare -a theArray - - while read -r line - do - theArray+=("$line") - done <<< "$input_file" - - for line in "${theArray[@]}" - do - bare_line=${line} - #echo "$line" >> ${log_file} - - # if input file has no path specified - if [[ ${line} != *"/"* ]]; then - line="${cwd}/${line}" - fi - - # substitute parts of the old path, from using the symlink folder, to the non-symlink folder - # example: - # "/home/poq/syncDir/0_downloads/topBanner.jpg" > "/home/poq/nextcloud/syncDir/0_downloads/topBanner.jpg" - # - # please note, if a file outside of the sync directory is tp'ed, then the replacement will not happen. - # this is great, as trash-put should work normally outside of the sync-dir. and for files residing outside, - # no replacemant should be done. - - # new_file=${original_string//old_substring/new_substring} - new_file=${line//$sync_dir_sym/$sync_dir} - - if [[ -f "${new_file}" ]] || [[ -d "${new_file}" ]] ; then - #trash-put "${new_file}" - trash-put "${bare_line}" - #echo "trash-put ${new_file}" - #echo "${new_file}" >> ${log_file} - else - echo "error: unable to delete \"${new_file}\"" - fi - - done - -done