ui5-tooling
ui5-tooling copied to clipboard
Adapters are writing files to incorrect locations when virBasePath is not matched
Expected Behavior
Adapters should have a better error handling for invalid file paths (virBasePath not matched).
Current Behavior
Memory
const workspace = resourceFactory.createAdapter({
virBasePath: "/resources/"
});
workspace.write(resourceFactory.createResource({
path: "/test/lib/messagebundle.properties",
string: "KEY=VALUE"
})).then(() => {
workspace.byPath("/resources/essagebundle.properties").then((res) => {
console.log(res.getPath());
// => /test/lib/messagebundle.properties
});
});
FileSystem
const workspace = resourceFactory.createAdapter({
fsBasePath: "./foo",
virBasePath: "/resources/"
});
workspace.write(resourceFactory.createResource({
path: "/test/lib/messagebundle.properties",
string: "KEY=VALUE"
})).then(() => {
workspace.byPath("/resources/essagebundle.properties").then((res) => {
console.log(res.getPath());
// => /test/lib/messagebundle.properties
});
});