mirror of
https://github.com/RubyMetric/chsrc
synced 2026-02-27 17:41:18 +08:00
增加 chsrc_run_directly() 并修复 pip 在 get 时在 Windows 上找不到路径的问题
[GitHub #286]
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* | BingChunMoLi <bingchunmoli@bingchunmoli.com>
|
||||
* |
|
||||
* Created On : <2023-08-29>
|
||||
* Last Modified : <2025-08-27>
|
||||
* Last Modified : <2025-09-12>
|
||||
*
|
||||
* chsrc framework
|
||||
* ------------------------------------------------------------*/
|
||||
@@ -1348,6 +1348,28 @@ chsrc_run_as_a_service (const char *cmd)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 以纯粹的方式直接运行命令,不做任何多余处理,
|
||||
* 命令执行前显示给用户,并保留所有输出给用户
|
||||
*
|
||||
* @return 返回命令的退出状态
|
||||
*/
|
||||
int
|
||||
chsrc_run_directly (const char *cmd)
|
||||
{
|
||||
if (ENGLISH)
|
||||
xy_log_brkt (blue (App_Name), bdblue ("RUN"), blue (cmd));
|
||||
else
|
||||
xy_log_brkt (blue (App_Name), bdblue ("运行"), blue (cmd));
|
||||
|
||||
if (in_dry_run_mode())
|
||||
{
|
||||
return 0; // Dry Run 此时立即结束,并不真正执行
|
||||
}
|
||||
int status = system (cmd);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 在本目录创建一个临时文件
|
||||
|
||||
Reference in New Issue
Block a user