cmptest: regexdemo (todo)

This commit is contained in:
xushiwei
2024-07-29 11:44:49 +08:00
parent cbd891785e
commit e0e3664fdb
5 changed files with 12 additions and 4 deletions

3
xtool/env/env.go vendored
View File

@@ -36,11 +36,8 @@ func ExpandEnv(s string) string {
func expandEnvWithCmd(s string) string {
expanded := reSubcmd.ReplaceAllStringFunc(s, func(m string) string {
subcmd := strings.TrimSpace(m[2 : len(m)-1])
args := parseSubcmd(subcmd)
cmd := args[0]
if cmd != "pkg-config" && cmd != "llvm-config" {
fmt.Fprintf(os.Stderr, "expand cmd only support pkg-config and llvm-config: '%s'\n", subcmd)
return ""