#!/bin/bash

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Remove various cached files that are intended to improve performance
# but can cause errors as the environment evolves.

# Move to the root of the git repository.
cd $(git rev-parse --show-toplevel)

# Clean all python cache files.
find src/ tests/ | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf

# Remove any local tox environments.
rm -rf .*tox/

# Delete the docker volume we use for caching tox environment.
docker volume rm mozanalysis-tox
