Skip to content
Snippets Groups Projects
Commit 57dd066b authored by Brandon Rodriguez's avatar Brandon Rodriguez
Browse files

Improve script output text

parent 9bc9a61a
Branches
No related merge requests found
......@@ -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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment