Skip to content

Instantly share code, notes, and snippets.

@xcatliu
Created September 21, 2017 06:47
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 xcatliu/7fe29851f420d9b5fcd3c0cf348fec9a to your computer and use it in GitHub Desktop.
Save xcatliu/7fe29851f420d9b5fcd3c0cf348fec9a to your computer and use it in GitHub Desktop.
Run scripts in a period of history version of a repo
#!/bin/sh
start="2017-07-01"
end="2017-08-01"
endNextDay=`date -d "$end next-day" +%Y-%m-%d`
current=$start
while [ "$current" != "$endNextDay" ]
do
echo "Checking out git to $current"
next=`date -d "$current next-day" +%Y-%m-%d`
git checkout `git rev-list -n 1 --before="$next 00:00:00" master`
# Run a script in this version
# echo "Running cqc and output to scripts/cqc/archives/$current-js.json"
# cqc "src/**/*.js" "src/**/*.jsx" --ignore-path ../.eslintignore -f json > scripts/cqc/archives/$current-js.json
current=$next
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment