Last active
January 2, 2016 17:19
-
-
Save hara-y-u/8335649 to your computer and use it in GitHub Desktop.
find out dated files for enja-oss/stylus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ORIG_DIR='./stylus_orig' | |
CLONE_TO='git clone https://github.com/LearnBoost/stylus.git' | |
LIST_DOCS='git ls-tree --name-only HEAD docs/' | |
LAST_TIME='git log -1 --pretty=format:%ct' | |
LAST_TIME_F='git log -1 --pretty=format:%cr' | |
DEV=false | |
${CLONE_TO} ${ORIG_DIR} > /dev/null 2>&1 | |
files=$(${LIST_DOCS}) | |
orig_files=$(cd ${ORIG_DIR}; ${LIST_DOCS}) | |
# TODO: fast implementation | |
for file in $files; do | |
time=$($LAST_TIME $file) | |
for orig_file in $orig_files; do | |
orig_time=$(cd $ORIG_DIR; $LAST_TIME $orig_file) | |
orig_time_f=$(cd $ORIG_DIR; $LAST_TIME_F $orig_file) | |
if [ $file = $orig_file ]; then | |
if [ $(echo "${time} < ${orig_time}" | bc) -ne 0 ]; then | |
printf "file:%s\tmodified_at:%s\n" $file "${orig_time_f}" | |
fi | |
fi | |
done | |
done | |
if [ $DEV = false ]; then | |
rm -rf ${ORIG_DIR} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment