mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
22 lines
606 B
Python
22 lines
606 B
Python
import os
|
|
import argparse
|
|
import subprocess
|
|
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser(description="Script to set environment variables and run different environments.")
|
|
parser.add_argument(
|
|
"environment",
|
|
choices=["production", "development"],
|
|
nargs="?",
|
|
default="production",
|
|
help="Specify the environment to run.",
|
|
)
|
|
args = parser.parse_args()
|
|
try:
|
|
if args.environment:
|
|
os.environ["CURRENT_ENV"] = args.environment
|
|
subprocess.run(["python", "main.py"])
|
|
except KeyboardInterrupt:
|
|
pass
|