diff --git a/run.sh b/run.sh index ba6e1306bb06986965efb84cd5b919fe3e951420..5b204067e0b18d2fcae9000c86d6b910fd3a4da6 100755 --- a/run.sh +++ b/run.sh @@ -19,8 +19,6 @@ output_subdir="" # Script start. ## function main () { - display_args_kwargs - # Check number of passed function args. if [[ ${#args[@]} > 1 ]] then @@ -61,6 +59,13 @@ function main () { exit 1 fi + echo -e "${text_blue}Moving all files from ${input_dir}.${text_reset}" + echo -e "${text_blue}Output dir is ${output_dir}.${text_reset}" + if [[ "${flags[@]}" =~ "no-sort" ]] + then + echo -e "${text_blue}Files will be sorted by extension type.${text_reset}" + fi + echo "" # Loop through all files in input directory. for file in ${input_dir}/* @@ -72,6 +77,9 @@ function main () { fi done + echo "" + echo -e "${text_blue}Files have been moved to ${output_dir}.${text_reset}" + # Handle for too few args. else echo -e "${text_red}Too few args passed. Expected at least two.${text_reset}" @@ -405,8 +413,9 @@ function move_file () { local input_location="${input_dir}/${orig_file_location}" local output_location="${output_subdir}/${file_name}${file_extension}" - echo -e "Moving ${text_purple}${orig_file_name}${file_extension}${text_reset} to ${text_purple}${output_location}${text_reset}" + echo -e "Moving ${text_purple}${orig_file_location}${text_reset} to ${text_purple}${output_location}${text_reset}" mv ${input_location} ${output_location} } + main