Commit 1eea36bc authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

update command: csst env show

parent 82d5488b
......@@ -68,26 +68,10 @@ def show(name):
return
# 使用 glob 获取所有可用的环境文件
env_files = glob.glob("./envs/*.env")
available_configs = [os.path.splitext(os.path.basename(f))[0] for f in env_files]
# 检查请求的配置是否存在
if name not in available_configs:
click.echo(
f"Error: Predefined env file '{name}' does not exist.",
err=True,
)
click.echo("Available env files:")
for config in available_configs:
click.echo(f" - {config}")
return
# 构建完整的文件路径
env_file_path = os.path.join("./envs", f"{name}.env")
env_file = os.path.join(APP_DIR, f"envs/{name}.env")
# 读取并打印文件内容
try:
with open(env_file_path, "r") as file:
with open(env_file, "r") as file:
content = file.read()
click.echo(content)
except IOError as e:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment