Skip to content

Commit

Permalink
path -> path.posix
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Dec 18, 2020
1 parent 6793890 commit 7bfa12f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/processors/bundlers/manifestBundler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require("path");
const posixPath = require("path").posix;
const yazl = require("yazl");
const resourceFactory = require("@ui5/fs").resourceFactory;
const log = require("@ui5/logger").getLogger("builder:processors:bundlers:manifestBundler");
Expand All @@ -23,7 +23,7 @@ class I18nResourceList {
* @param {module:@ui5/fs.Resource} resource i18n resource
*/
add(directory, resource) {
const normalizedDirectory = path.normalize(directory);
const normalizedDirectory = posixPath.normalize(directory);
if (!this.propertyFiles.has(normalizedDirectory)) {
this.propertyFiles.set(normalizedDirectory, [resource]);
} else {
Expand All @@ -38,7 +38,7 @@ class I18nResourceList {
* @returns {Array} Array of resources files
*/
get(directory) {
return this.propertyFiles.get(path.normalize(directory)) || [];
return this.propertyFiles.get(posixPath.normalize(directory)) || [];
}
}

Expand Down Expand Up @@ -72,8 +72,8 @@ module.exports = ({resources, options: {namespace, bundleName, propertiesExtensi
return;
}
descriptorI18nInfos.set(
path.join(path.dirname(manifest.path), path.dirname(i18nPath)),
path.basename(i18nPath, propertiesExtension)
posixPath.join(posixPath.dirname(manifest.path), posixPath.dirname(i18nPath)),
posixPath.basename(i18nPath, propertiesExtension)
);
}

Expand Down Expand Up @@ -115,7 +115,7 @@ module.exports = ({resources, options: {namespace, bundleName, propertiesExtensi

return Promise.all(resources.map((resource) =>
resource.getBuffer().then((content) => {
const basename = path.basename(resource.getPath());
const basename = posixPath.basename(resource.getPath());
return {
name: basename,
isManifest: basename === descriptor,
Expand All @@ -133,7 +133,7 @@ module.exports = ({resources, options: {namespace, bundleName, propertiesExtensi
addDescriptorI18nInfos(descriptorI18nInfos, resource);
archiveContent.set(resource.path, resource.content);
} else {
const directory = path.dirname(resource.path);
const directory = posixPath.dirname(resource.path);
i18nResourceList.add(directory, resource);
}
});
Expand Down

0 comments on commit 7bfa12f

Please sign in to comment.