MCPcopy Create free account
hub / github.com/52funny/pikpakcli / expandLocalPatternToken

Function expandLocalPatternToken

internal/shell/shell.go:942–956  ·  view source on GitHub ↗
(token string)

Source from the content-addressed store, hash-verified

940}
941
942func expandLocalPatternToken(token string) ([]string, error) {
943 if !hasWildcard(token) {
944 return []string{token}, nil
945 }
946
947 pattern := utils.ExpandLocalPath(token)
948 matches, err := filepath.Glob(pattern)
949 if err != nil {
950 return nil, fmt.Errorf("shell: invalid wildcard pattern %s: %w", token, err)
951 }
952 if len(matches) == 0 {
953 return nil, fmt.Errorf("shell: no matches found for %s", token)
954 }
955 return matches, nil
956}
957
958func consumesNextValue(token string) bool {
959 switch token {

Callers 1

expandUploadGlobsFunction · 0.85

Calls 2

ExpandLocalPathFunction · 0.92
hasWildcardFunction · 0.70

Tested by

no test coverage detected