Update error message in color check.
Remind user if 'ANDROID_BUILD_TOP' hasn't been set
Bug: 65850237
Test: In terminal without android environment, try
to run 'repo upload'
Change-Id: I7cbd903d3b2ac08ddbd3ae6912e7d1e0bc76d2ca
diff --git a/checkcolor.py b/checkcolor.py
index 9e62d3d..204c7e5 100755
--- a/checkcolor.py
+++ b/checkcolor.py
@@ -72,6 +72,9 @@
except OSError as e:
if e.errno == errno.ENOENT:
print 'Error in color lint check'
+ if not os.environ.get('ANDROID_BUILD_TOP'):
+ print 'Try setting up your environment first:'
+ print ' source build/envsetup.sh && lunch <target>'
sys.exit(1)
return (exitcode, stdout)