diff --git a/tools/setup/generate_zulip_bots_static_files b/tools/setup/generate_zulip_bots_static_files index f5ff16bf8d..3baf00ada9 100755 --- a/tools/setup/generate_zulip_bots_static_files +++ b/tools/setup/generate_zulip_bots_static_files @@ -15,6 +15,10 @@ from zulip_bots.lib import get_bots_directory_path bots_dir = os.path.join(settings.STATIC_ROOT, 'generated/bots') +if os.path.isdir(bots_dir): + # delete old static files, they could be outdated + shutil.rmtree(bots_dir) + os.makedirs(bots_dir, exist_ok=True) def copyfiles(paths):