provision.py: Add a conditional to remove '.eslintcache'.

It was discovered that the '.eslintcache' file was causing eslint to
throw a TypeError after a recent update/addition to the dependencies.
It makes sense to remove this file as part of the provisioning process
to avoid such exceptions.
This commit is contained in:
Wyatt Hoodes 2019-04-18 22:10:16 -10:00 committed by Tim Abbott
parent c40eb524de
commit ececf0a209
1 changed files with 8 additions and 0 deletions

View File

@ -575,6 +575,14 @@ def main(options):
run(["scripts/lib/clean-unused-caches"])
# Keeping this cache file around can cause eslint to throw
# random TypeErrors when new/updated dependencies are added
if os.path.isfile('.eslintcache'):
# Remove this block when
# https://github.com/eslint/eslint/issues/11639 is fixed
# upstream.
os.remove('.eslintcache')
version_file = os.path.join(UUID_VAR_PATH, 'provision_version')
print('writing to %s\n' % (version_file,))
open(version_file, 'w').write(PROVISION_VERSION + '\n')