Fix pathes in gdl-update-todo.sh script
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
# echo "Usage: `basename $0` [--no-abort-on-found] [--parallel] [--custom-grep-search|-c <string>]"
|
# echo "Usage: `basename $0` [--no-abort-on-found] [--parallel] [--custom-grep-search|-c <string>]"
|
||||||
echo "Usage: `basename $0` [--custom-grep-search|-c <string>]"
|
echo "Usage: $(basename $0) [--custom-grep-search|-c <string>]"
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " --no-abort-on-found (optional) The script will not update each gallery download until it finds an already downloaded file."
|
echo " --no-abort-on-found (optional) The script will not update each gallery download until it finds an already downloaded file."
|
||||||
echo " --no-parallel (optional) The script will update the found URLs in sequence"
|
echo " --no-parallel (optional) The script will update the found URLs in sequence"
|
||||||
@@ -18,18 +18,32 @@ custom_grep_search=''
|
|||||||
|
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--help|-h) show_help; exit ;;
|
--help | -h)
|
||||||
--no-abort-on-found) should_abort_on_found=false; shift ;;
|
show_help
|
||||||
--no-parallel|-n) parallel=false; shift ;;
|
exit
|
||||||
--custom-grep-search|-c) custom_grep_search="$2"; shift 2 ;;
|
;;
|
||||||
*) shift ;;
|
--no-abort-on-found)
|
||||||
|
should_abort_on_found=false
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-parallel | -n)
|
||||||
|
parallel=false
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--custom-grep-search | -c)
|
||||||
|
custom_grep_search="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
*) shift ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
gallery_dl_path=/mnt/e/home/documents/data-hoarding
|
gallery_dl_path=/mnt/e/home/documents/data-hoarding
|
||||||
cd "$gallery_dl_path"
|
cd "$gallery_dl_path"
|
||||||
|
|
||||||
urls=($(grep -v "filter" -i "$gallery_dl_path/todo.md" | grep -Eo "(mastodon:)?(http|https)://[a-zA-Z0-9.(/~@)?=_%:-]*"))
|
todo_md_filepath='/mnt/e/home/clouds/google-drive/obsidian-vaults/notes/idk/furry/cool-artists.md'
|
||||||
|
|
||||||
|
urls=($(grep -v "filter" -i "$todo_md_filepath" | grep -Eo "(mastodon:)?(http|https)://[a-zA-Z0-9.(/~@)?=_%:-]*"))
|
||||||
|
|
||||||
if [ ! -z "$custom_grep_search" ]; then
|
if [ ! -z "$custom_grep_search" ]; then
|
||||||
filtered_urls=()
|
filtered_urls=()
|
||||||
@@ -124,7 +138,10 @@ if false; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if $should_use_tmux; then
|
if $should_use_tmux; then
|
||||||
session_name="tmp_gdl-update-todo-`uuidgen | sed 's/[-]//g' | head -c 10; echo;`"
|
session_name="tmp_gdl-update-todo-$(
|
||||||
|
uuidgen | sed 's/[-]//g' | head -c 10
|
||||||
|
echo
|
||||||
|
)"
|
||||||
|
|
||||||
tmux new-session -d -s $session_name
|
tmux new-session -d -s $session_name
|
||||||
|
|
||||||
@@ -135,7 +152,7 @@ if $should_use_tmux; then
|
|||||||
for ((i = 0; i < ${#commands_list[@]}; i++)); do
|
for ((i = 0; i < ${#commands_list[@]}; i++)); do
|
||||||
command_to_run="${commands_list[$i]}"
|
command_to_run="${commands_list[$i]}"
|
||||||
|
|
||||||
if [ "$i" -eq 0 ] || [ $(( i % 4 )) -eq 0 ]; then
|
if [ "$i" -eq 0 ] || [ $((i % 4)) -eq 0 ]; then
|
||||||
if [ "$i" -ne 0 ]; then
|
if [ "$i" -ne 0 ]; then
|
||||||
tmux new-window -t $session_name
|
tmux new-window -t $session_name
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user