diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index aaed966..9c4420a 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -338,8 +338,12 @@ handle_mime() { } handle_fallback() { - echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5 - exit 1 + if [ "$(file --dereference --brief -- "${FILE_PATH}"| cut -d' ' -f1)" = "JSON" ]; then + jq --color-output . "${FILE_PATH}" && exit 5 + else + echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5 + exit 1 + fi }