修复某些系统which不存在的问题 (#271)

This commit is contained in:
Mikachu2333 2025-08-20 10:45:08 +08:00 committed by GitHub
parent 795ed0964f
commit b6a910143d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -339,29 +339,33 @@ query_program_exist (char *check_cmd, char *prog_name, int mode)
/**
* @brief '' chsrc_check_program()
* @brief chsrc_check_program()
*
* 使 "调用 程序名 --version" ( cmd_to_check_program2())
*
*
* 1. ()
* 2. 使 --version mvn
* 3. --version ()
*
* @note Unix where zsh 使sh Bash 使
* Unix 使 which whereis
* @note
* 1. Unix where zsh 使sh Bash 使
* 2. linux系统没有 `which` `whereis` 使 `command -v`
*/
static char *
cmd_to_check_program (char *prog_name)
{
char *check_tool = xy_on_windows ? "where " : "which ";
char *check_tool = xy_on_windows ? "where " : "command -v ";
char *quiet_cmd = xy_str_to_quietcmd (xy_2strjoin (check_tool, prog_name));
return quiet_cmd;
}
XY_Deprecate_This("Use cmd_to_check_program() instead")
/**
* @brief ` --version`
*
* @deprecated
*
* 1. ()
* 2. 使 --version mvn
* 3. --version ()
*/
static char *
cmd_to_check_program2 (char *prog_name)
{