forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cloning flutter repo for luci recipes (flutter#21532)
* cloning flutter repo for luci recipes * rename the file, script does not clone the repo, but reset it to the right commit * adding the version logging
- Loading branch information
nturgut
authored
Oct 1, 2020
1 parent
2c3fc4a
commit 9193e2e
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
if [[ -z $ENGINE_PATH ]] | ||
then | ||
echo "Please set ENGINE_PATH environment variable." | ||
exit 1 | ||
fi | ||
|
||
# Go to the engine git repo to get the date of the latest commit. | ||
cd $ENGINE_PATH/src/flutter | ||
|
||
# Get latest commit's time for the engine repo. | ||
# Use date based on local time otherwise timezones might get mixed. | ||
LATEST_COMMIT_TIME_ENGINE=`git log -1 --date=local --format="%cd"` | ||
echo "Latest commit time on engine found as $LATEST_COMMIT_TIME_ENGINE" | ||
|
||
if [[ -z $FLUTTER_CLONE_REPO_PATH ]] | ||
then | ||
echo "Please set FLUTTER_CLONE_REPO_PATH environment variable." | ||
exit 1 | ||
else | ||
cd $FLUTTER_CLONE_REPO_PATH | ||
fi | ||
|
||
# Get the time of the youngest commit older than engine commit. | ||
# Git log uses commit date not the author date. | ||
# Before makes the comparison considering the timezone as well. | ||
COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` | ||
echo "Using the flutter/flutter commit $COMMIT_NO"; | ||
git reset --hard $COMMIT_NO | ||
|
||
# Print out the flutter version for troubleshooting | ||
$FLUTTER_CLONE_REPO_PATH/bin/flutter --version |