kimlew / bash-sort-images

Script that sorts photo files into year & month subdirectories, and if needed, day
0 stars 0 forks source link

Unusual indentation in the `case` statement in the main loop #4

Closed kcharter closed 4 years ago

kcharter commented 4 years ago

Github shows the case statement in the main loop with funny indentation:

https://github.com/kimlew/bash-sort-images/blob/16847406d5bedc500235cf93c761493c8a512b7d/sort_images.sh#L126-L148

i think that conventionally code below each case pattern is indented further that the pattern:

case $day_subdir_also in
  [yY] | [yY][eE][sS])
    # stuff indented at this level
    ;;
  [nN] | [nN][oO])
    # more stuff indented at this level
    ;;
  *)
    # yet more stuff
    ;;
esac

It could be that one of your editors is configured to insert tabs. But it looks the same way in less and in atom so I don't think that's the problem. I think maybe some of your code just needs to be indented another six spaces to the right.

kimlew commented 4 years ago

@kcharter As you suggested, I have corrected the indentation.

kcharter commented 4 years ago

@kimlew indentation looks good to me now, though I'm not sure which commit you did that in. Probably commit 230b5bfdbb767e52856e87f12a662e7ba412c139, where you transformed the case into an if-else.

kcharter commented 4 years ago

Feel free to close this, or let me know if you'd prefer that I do it.

kimlew commented 4 years ago

@kcharter Indentation was fixed in Issue #1. I can close all 4 issues on this branch.