Skip to content

Commit

Permalink
fix: path parameter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon committed Nov 7, 2024
1 parent c637851 commit 046731b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/adapter/GitAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class GitAdapter {
const bufferFiles: { path: string; content: Buffer }[] = []
for (const filePath of filesPath) {
const fileContent = await this.getBufferContent({
path,
path: filePath,
oid: this.config.to,
})
bufferFiles.push({
Expand All @@ -117,12 +117,12 @@ export default class GitAdapter {
for (const changeType of [ADDITION, MODIFICATION, DELETION]) {
const linesOfType = await this.getDiffForType(changeType)
lines.push(
...linesOfType.map(statLine =>
treatPathSep(statLine).replace(NUM_STAT_REGEX, `${changeType}${TAB}`)
...linesOfType.map(line =>
line.replace(NUM_STAT_REGEX, `${changeType}${TAB}`)
)
)
}
return lines
return lines.map(treatPathSep)
}

protected async getDiffForType(changeType: string): Promise<string[]> {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/fsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export const copyFiles = async (config: Config, src: string) => {
}
try {
const gitAdapter = GitAdapter.getInstance(config)
const files = await gitAdapter.getFilesFrom(src)
for (const file of files) {
for await (const file of gitAdapter.getFilesFrom(src)) {
// Use Buffer to output the file content
// Let fs implementation detect the encoding ("utf8" or "binary")
const dst = join(config.output, file.path)
Expand Down

0 comments on commit 046731b

Please sign in to comment.