Skip to content

Instantly share code, notes, and snippets.

@codekiln
Created November 15, 2017 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codekiln/a8ecfd7c087eb9bccd72e5c75a154b49 to your computer and use it in GitHub Desktop.
Save codekiln/a8ecfd7c087eb9bccd72e5c75a154b49 to your computer and use it in GitHub Desktop.
list all sorted django management commands using git
#!/usr/bin/env bash
# after running this command, the list of management commands will be in
# `sorted_management_commands.txt`, which you can `cat` out.
rm -f management_commands.txt
touch management_commands.txt
for i in **/management/commands/*.py
do echo "$(git log -1 --format='%ad | %C(green)%ae%Creset |' --date=short -- $i) $i" >> management_commands.txt
done
cat management_commands.txt | sort >! sorted_management_commands.txt
cat sorted_management_commands.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment