diff --git a/readme.md b/readme.md index 5044d5d919a55df7c31012180ff9184fd730d6c9..53c4ef4a3b7073d4900f291d82c103d54ac774fb 100644 --- a/readme.md +++ b/readme.md @@ -12,3 +12,6 @@ Organizes files by type. ### Args * First arg (required) - Expected to be the input directory. * Second arg (required) - Expected to be the output directory. + +### Flags +* `-no-exe` - Skips handling of windows exe files. diff --git a/run.sh b/run.sh index 4a43398fe186fac40385cffa8ac30dd9ad0dc260..6ea0b08f098266881c6c413949c44716dc3532be 100755 --- a/run.sh +++ b/run.sh @@ -208,6 +208,25 @@ function handle_file () { move_file + # Handle windows executable files. + elif [[ "${file_extension}" == ".exe" ]] + then + # Only proceed if flags aren't set. + if [[ ! "${flags[@]}" =~ "no-exe" ]] + then + output_subdir="${output_dir}/Executables" + + # Verify location exists. + if [[ ! -d ${output_subdir} ]] + then + mkdir ${output_subdir} + fi + + # Move file. + move_file + fi + + # Handle all other file types. else # Check if file had a period in its name. If so, we can check against a smaller extension value.