Quiet and noisy at your disposal

This commit is contained in:
Aoran Zeng
2024-09-03 20:03:45 +08:00
parent 31b4658477
commit 6831cfaede
4 changed files with 70 additions and 28 deletions

View File

@@ -35,7 +35,7 @@ void
pl_go_check_cmd ()
{
char *check_cmd = xy_str_to_quietcmd ("go version");
bool exist = query_program_exist (check_cmd, "go");
bool exist = query_program_exist (check_cmd, "go", Noisy_When_Exist|Noisy_When_NonExist);
if (!exist)
{

View File

@@ -33,14 +33,9 @@ def_sources_n(pl_nodejs);
void
pl_nodejs_check_cmd (bool *npm_exist, bool *yarn_exist, bool *pnpm_exist)
{
char *check_cmd = xy_str_to_quietcmd ("npm -v");
*npm_exist = query_program_exist (check_cmd, "npm");
check_cmd = xy_str_to_quietcmd ("yarn -v");
*yarn_exist = query_program_exist (check_cmd, "yarn");
check_cmd = xy_str_to_quietcmd ("pnpm -v");
*pnpm_exist = query_program_exist (check_cmd, "pnpm");
*npm_exist = chsrc_check_program ("npm");
*yarn_exist = chsrc_check_program ("yarn");
*pnpm_exist = chsrc_check_program ("yarn");
if (!*npm_exist && !*yarn_exist && !*pnpm_exist)
{

View File

@@ -67,7 +67,7 @@ os_freebsd_setsrc (char *option)
// @ccmywish: [2023-09-27] 据 @ykla , NJU的freebsd-ports源没有设置 Git
// 但是我认为由于使用Git还是要比非Git方便许多我们尽可能坚持使用Git
// 而 gitup 又要额外修改它自己的配置,比较麻烦
bool git_exist = query_program_exist (xy_str_to_quietcmd ("git version"), "git");
bool git_exist = query_program_exist (xy_str_to_quietcmd ("git version"), "git", Noisy_When_Exist|Noisy_When_NonExist);
if (git_exist)
{
if (xy_streql("nju",source.mirror->code))