mirror of https://github.com/databricks/cli.git
Compare commits
2 Commits
2f7f470395
...
11eadba81b
Author | SHA1 | Date |
---|---|---|
shreyas-goenka | 11eadba81b | |
Andrew Nester | 7f3fb10c4a |
|
@ -44,6 +44,11 @@ func (m *prependWorkspacePrefix) Apply(ctx context.Context, b *bundle.Bundle) di
|
||||||
return dyn.InvalidValue, fmt.Errorf("expected string, got %s", v.Kind())
|
return dyn.InvalidValue, fmt.Errorf("expected string, got %s", v.Kind())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip prefixing if the path does not start with /, it might be variable reference or smth else.
|
||||||
|
if !strings.HasPrefix(path, "/") {
|
||||||
|
return pv, nil
|
||||||
|
}
|
||||||
|
|
||||||
for _, prefix := range skipPrefixes {
|
for _, prefix := range skipPrefixes {
|
||||||
if strings.HasPrefix(path, prefix) {
|
if strings.HasPrefix(path, prefix) {
|
||||||
return pv, nil
|
return pv, nil
|
||||||
|
|
|
@ -31,6 +31,14 @@ func TestPrependWorkspacePrefix(t *testing.T) {
|
||||||
path: "/Volumes/Users/test",
|
path: "/Volumes/Users/test",
|
||||||
expected: "/Volumes/Users/test",
|
expected: "/Volumes/Users/test",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "~/test",
|
||||||
|
expected: "~/test",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "${workspace.file_path}/test",
|
||||||
|
expected: "${workspace.file_path}/test",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
|
Loading…
Reference in New Issue