diff --git a/piggy/piggybank.py b/piggy/piggybank.py index 110bb21..6c88c55 100644 --- a/piggy/piggybank.py +++ b/piggy/piggybank.py @@ -115,3 +115,11 @@ def recursive_sort(data): PIGGYMAP = generate_piggymap(PIGGYBANK_FOLDER) + + +# DEVTOOL +def __update_piggymap(): + global PIGGYMAP + print("Rebuilding piggymap") + PIGGYMAP = generate_piggymap(PIGGYBANK_FOLDER) + print("Piggymap rebuilt") diff --git a/run.py b/run.py index 629e842..5b5f70d 100644 --- a/run.py +++ b/run.py @@ -23,6 +23,8 @@ def checkout_branch(branch): if __name__ == "__main__": from piggy.devtools import inject_devtools + from piggy.piggybank import __update_piggymap + # TODO: Re-enable checkout_branch("test-output") os.environ["FLASK_DEBUG"] = "1" @@ -35,6 +37,8 @@ def checkout_branch(branch): run_tailwind(reload=True) subprocess.Popen('npx livereload "piggy/, piggybank/"', shell=True) + __update_piggymap() + app.run(port=5001) else: # TODO: Re-enable