func findTaskInPlugins()

in plugin.go [183:206]


func findTaskInPlugins(plg string) (string, error) {
	plgs, err := newPlugins()
	if err != nil {
		return "", err
	}

	// check that plg is the suffix of a folder name in plgs.local
	for _, path := range plgs.local {
		folder := filepath.Base(path)
		if strings.TrimPrefix(folder, "olaris-") == plg {
			return path, nil
		}
	}

	// check that plg is the suffix of a folder name in plgs.ops
	for _, path := range plgs.ops {
		folder := filepath.Base(path)
		if strings.TrimPrefix(folder, "olaris-") == plg {
			return path, nil
		}
	}

	return "", &TaskNotFoundErr{input: plg}
}