Skip to content

Commit

Permalink
Merge pull request #83 from Folltoshe/main
Browse files Browse the repository at this point in the history
chore: 优化启动脚本
  • Loading branch information
ikun0014 authored Nov 17, 2024
2 parents 92a69f0 + b45c3a7 commit dcfe8a4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 38 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "2.0.0.beta-12",
"description": "一个适配 LX Music 的 API 后端实现",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "poetry run python poetry_run.py development",
"prod": "poetry run python poetry_run.py production",
"development": "poetry run python poetry_run.py development",
"production": "poetry run python poetry_run.py production",
"install": "poetry install"
"dev": "python run.py development",
"prod": "python run.py production",
"install": "pip install -r requirements.txt",
"poetry:install": "poetry install",
"poetry:development": "poetry run python run.py development",
"poetry:production": "poetry run python run.py production"
}
}
}
23 changes: 0 additions & 23 deletions poetry_run.py

This file was deleted.

21 changes: 21 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
description = "Description not available"

setup(
name='lx_music_api_server_setup',
name="lx_music_api_server_setup",
version=version,
scripts=['poetry_run.py'],
author='helloplhm-qwq',
author_email='[email protected]',
scripts=["run.py"],
author="helloplhm-qwq",
author_email="[email protected]",
description=description,
url='https://github.com/helloplhm-qwq/lx-music-api-server',
url="https://github.com/helloplhm-qwq/lx-music-api-server",
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)

0 comments on commit dcfe8a4

Please sign in to comment.