User:LadyAlys/SandboxDiffScript

diffdir=~/code/diffdir mkdir -p $diffdir $diffdir/habitrpg

cd $diffdir/habitrpg for file_old in package.json Gruntfile.js config.json.example website/src/models/user.js website/src/routes/apiv2.coffee common/script/content.coffee common/script/index.coffee do url="https://raw.githubusercontent.com/HabitRPG/habitrpg/develop/$file_old" file_new="new" curl -o "$file_new" "$url" 2> /dev/null if [ -f "$file_old" ]; then diffs=`diff "$file_old" "$file_new"` if [ "$diffs" = "" ]; then echo no differences for $file_old mv -f "$file_new" /tmp/ else diff "$file_old" "$file_new" echo echo mv -i "$file_new" "$file_old" fi else echo creating new copy of: $file_old mkdir -p "$file_old"; rmdir "$file_old" # create subdirectories mv -i "$file_new" "$file_old" fi done