diff --git a/src/adapter/GitAdapter.ts b/src/adapter/GitAdapter.ts index 08bbd9ad..d8477b94 100644 --- a/src/adapter/GitAdapter.ts +++ b/src/adapter/GitAdapter.ts @@ -22,8 +22,7 @@ const TREE_TYPE = 'tree' const NUM_STAT_REGEX = /^((\d+|\-)\t){2}/ const EOL = new RegExp(/\r?\n/) -const revPath = (pathDef: FileGitRef) => - `${pathDef.oid}:${treatPathSep(pathDef.path)}` +const revPath = (pathDef: FileGitRef) => `${pathDef.oid}:${pathDef.path}` export default class GitAdapter { private static instances: Map = new Map() @@ -89,7 +88,7 @@ export default class GitAdapter { '--name-only', '-r', this.config.to, - treatPathSep(path), + path, ]) ) .split(EOL) diff --git a/src/post-processor/flowTranslationProcessor.ts b/src/post-processor/flowTranslationProcessor.ts index 4a62d2c8..f128c6e6 100644 --- a/src/post-processor/flowTranslationProcessor.ts +++ b/src/post-processor/flowTranslationProcessor.ts @@ -12,7 +12,7 @@ import { import { MetadataRepository } from '../metadata/MetadataRepository' import type { Work } from '../types/work' import { readDir, writeFile } from '../utils/fsHelper' -import { isSamePath, isSubDir, readFile, treatPathSep } from '../utils/fsUtils' +import { isSamePath, isSubDir, readFile } from '../utils/fsUtils' import { asArray, convertJsonToXml, @@ -164,7 +164,7 @@ export default class FlowTranslationProcessor extends BaseProcessor { protected async _getTranslationAsJSON(translationPath: string) { const translationPathInOutputFolder = join( this.config.output, - treatPathSep(translationPath) + translationPath ) const translationExist = await pathExists(translationPathInOutputFolder) diff --git a/src/post-processor/includeProcessor.ts b/src/post-processor/includeProcessor.ts index 1f320ba5..3c3ee2df 100644 --- a/src/post-processor/includeProcessor.ts +++ b/src/post-processor/includeProcessor.ts @@ -5,7 +5,6 @@ import { MetadataRepository } from '../metadata/MetadataRepository' import DiffLineInterpreter from '../service/diffLineInterpreter' import type { Work } from '../types/work' import { TAB } from '../utils/cliConstants' -import { treatPathSep } from '../utils/fsUtils' import { IgnoreHelper, buildIncludeHelper } from '../utils/ignoreHelper' import BaseProcessor from './baseProcessor' @@ -52,7 +51,7 @@ export default class IncludeProcessor extends BaseProcessor { ) for (const line of lines) { Object.keys(includeHolder).forEach(changeType => { - const changedLine = `${changeType}${TAB}${treatPathSep(line)}` + const changedLine = `${changeType}${TAB}${line}` if (!this.includeHelper.keep(changedLine)) { includeHolder[changeType as keyof typeof includeHolder].push( changedLine diff --git a/src/utils/fsHelper.ts b/src/utils/fsHelper.ts index 9267ddec..e8ad9884 100644 --- a/src/utils/fsHelper.ts +++ b/src/utils/fsHelper.ts @@ -7,7 +7,6 @@ import GitAdapter from '../adapter/GitAdapter' import type { Config } from '../types/config' import type { FileGitRef } from '../types/git' -import { treatPathSep } from './fsUtils' import { buildIgnoreHelper } from './ignoreHelper' const copiedFiles = new Set() @@ -30,7 +29,7 @@ export const copyFiles = async (config: Config, src: string) => { // Use Buffer to output the file content // Let fs implementation detect the encoding ("utf8" or "binary") const dst = join(config.output, file.path) - await outputFile(treatPathSep(dst), file.content) + await outputFile(dst, file.content) copiedFiles.add(dst) } } catch { @@ -80,5 +79,5 @@ export const writeFile = async ( if (ignoreHelper.globalIgnore.ignores(path)) { return } - await outputFile(join(config.output, treatPathSep(path)), content) + await outputFile(join(config.output, path), content) }