Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-cicd
csst-dag
Commits
1eea36bc
Commit
1eea36bc
authored
Sep 11, 2025
by
BO ZHANG
🏀
Browse files
update command: csst env show
parent
82d5488b
Changes
1
Show whitespace changes
Inline
Side-by-side
app/csst.py
View file @
1eea36bc
...
@@ -68,26 +68,10 @@ def show(name):
...
@@ -68,26 +68,10 @@ def show(name):
return
return
# 使用 glob 获取所有可用的环境文件
# 使用 glob 获取所有可用的环境文件
env_files
=
glob
.
glob
(
"./envs/*.env"
)
env_file
=
os
.
path
.
join
(
APP_DIR
,
f
"envs/
{
name
}
.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"
)
# 读取并打印文件内容
# 读取并打印文件内容
try
:
try
:
with
open
(
env_file
_path
,
"r"
)
as
file
:
with
open
(
env_file
,
"r"
)
as
file
:
content
=
file
.
read
()
content
=
file
.
read
()
click
.
echo
(
content
)
click
.
echo
(
content
)
except
IOError
as
e
:
except
IOError
as
e
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment