From 6ce41d3314f4dfa866079a3ba8cf08172f6efd1e Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Mon, 22 Aug 2022 16:01:56 +0100 Subject: [PATCH] Check replace_files is run against production db --- app/replace_files.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/replace_files.py b/app/replace_files.py index b05d9a9..573000f 100755 --- a/app/replace_files.py +++ b/app/replace_files.py @@ -16,6 +16,7 @@ import glob import os import shutil +import sys from helpers import ( fade_point, @@ -60,6 +61,10 @@ print(f"{source_dir=}, {parent_dir=}") def main(): + if 'musicmuster_prod' not in os.environ.get('MM_DB'): + response = input("Not on production database - c to continue: ") + if response != "c": + sys.exit(0) tracks = os.listdir(parent_dir) for fname in os.listdir(source_dir): parent_file = os.path.join(parent_dir, fname)