fix windows bug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
This commit is contained in:
楚岳
2022-03-02 15:02:53 +08:00
parent 7f20b7c5be
commit 7b87a23f5a

View File

@@ -89,7 +89,7 @@ const (
)
// ParameterFileName is the addon resources/parameter.cue file name
var ParameterFileName = filepath.Join("resources", "parameter.cue")
var ParameterFileName = strings.Join([]string{"resources", "parameter.cue"}, "/")
// ListOptions contains flags mark what files should be read in an addon directory
type ListOptions struct {
@@ -182,7 +182,7 @@ var Patterns = []Pattern{{Value: ReadmeFileName}, {Value: MetadataFileName}, {Va
func GetPatternFromItem(it Item, r AsyncReader, rootPath string) string {
relativePath := r.RelativePath(it)
for _, p := range Patterns {
if strings.HasPrefix(relativePath, filepath.Join(rootPath, p.Value)) {
if strings.HasPrefix(relativePath, strings.Join([]string{rootPath, p.Value}, "/")) {
return p.Value
}
}