From 49b882ee651a03e9b53d50919904f077b983fa87 Mon Sep 17 00:00:00 2001 From: Sebastien Date: Tue, 4 Apr 2023 19:24:36 +0200 Subject: [PATCH] fix: get parent folder name portability (#562) --- src/service/inFolderHandler.js | 3 +-- src/service/inResourceHandler.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/service/inFolderHandler.js b/src/service/inFolderHandler.js index 9aaeed10..a779064f 100644 --- a/src/service/inFolderHandler.js +++ b/src/service/inFolderHandler.js @@ -5,7 +5,6 @@ const { META_REGEX, METAFILE_SUFFIX, } = require('../utils/metadataConstants') -const { GIT_PATH_SEP } = require('../utils/gitConstants') const { cleanUpPackageMember } = require('../utils/packageHelper') const { join, parse, sep } = require('path') const { readDir } = require('../utils/fsHelper') @@ -54,7 +53,7 @@ class InFolderHandler extends StandardHandler { _isProcessable() { const parsedLine = parse(this.line) - const parentFolder = parsedLine.dir.split(GIT_PATH_SEP).pop() + const parentFolder = parsedLine.dir.split(sep).pop() return ( super._isProcessable() || parentFolder !== this.type || diff --git a/src/service/inResourceHandler.js b/src/service/inResourceHandler.js index 8d166d9d..74d644ee 100644 --- a/src/service/inResourceHandler.js +++ b/src/service/inResourceHandler.js @@ -3,7 +3,7 @@ const StandardHandler = require('./standardHandler') const { join, parse } = require('path') const { pathExists, readDir } = require('../utils/fsHelper') const { META_REGEX } = require('../utils/metadataConstants') -const { GIT_PATH_SEP } = require('../utils/gitConstants') +const { sep } = require('path') const { cleanUpPackageMember } = require('../utils/packageHelper') const STATICRESOURCE_TYPE = 'staticresources' @@ -78,7 +78,7 @@ class ResourceHandler extends StandardHandler { _isProcessable() { const parsedLine = parse(this.line) - const parentFolder = parsedLine.dir.split(GIT_PATH_SEP).pop() + const parentFolder = parsedLine.dir.split(sep).pop() return ( super._isProcessable() ||