fix windows bug (#3351)

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
This commit is contained in:
wyike
2022-03-03 14:43:40 +08:00
committed by GitHub
parent 3399742709
commit 1cb4426e4b

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
}
}