...
1 package common
2
3 import (
4 "path/filepath"
5 "strings"
6
7 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
8 )
9
10 const _devPushPathAttributePrefix = "dev.odo.push.path:"
11
12
13
14 func GetSyncFilesFromAttributes(command v1alpha2.Command) map[string]string {
15 syncMap := make(map[string]string)
16 for key, value := range command.Attributes.Strings(nil) {
17 if strings.HasPrefix(key, _devPushPathAttributePrefix) {
18 localValue := strings.ReplaceAll(key, _devPushPathAttributePrefix, "")
19 syncMap[filepath.Clean(localValue)] = filepath.ToSlash(filepath.Clean(value))
20 }
21 }
22 return syncMap
23 }
24
View as plain text