Skip to content

Instantly share code, notes, and snippets.

@deadc
Created October 26, 2018 18:08
Show Gist options
  • Save deadc/1846a502a737fc61956c65e93b4d4bd0 to your computer and use it in GitHub Desktop.
Save deadc/1846a502a737fc61956c65e93b4d4bd0 to your computer and use it in GitHub Desktop.
Get last directory modified based on last commit
#!/bin/bash
set -e
FOLDER=$1
LATEST_COMMIT=$(git rev-parse HEAD)
FOLDER_COMMIT=$(git log -1 --format=format:%H --full-diff ${FOLDER})
[[ ${FOLDER_COMMIT} = ${LATEST_COMMIT} ]] && exit 0 || exit 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment