Skip to content

Commit 08137b7

Browse files
authored
fix: respect custom cwd, close #87 (#89)
1 parent ef59c46 commit 08137b7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/update-files.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,22 @@ import { ProgressEvent } from './types/version-bump-progress'
99
* Updates the version number in the specified files.
1010
*/
1111
export async function updateFiles(operation: Operation): Promise<Operation> {
12-
const { files } = operation.options
12+
const { files, cwd } = operation.options
1313

1414
for (const relPath of files) {
1515
const modified = await updateFile(relPath, operation)
16+
const absPath = path.resolve(cwd, relPath)
1617

1718
if (modified) {
1819
operation.update({
1920
event: ProgressEvent.FileUpdated,
20-
updatedFiles: operation.state.updatedFiles.concat(relPath),
21+
updatedFiles: operation.state.updatedFiles.concat(absPath),
2122
})
2223
}
2324
else {
2425
operation.update({
2526
event: ProgressEvent.FileSkipped,
26-
skippedFiles: operation.state.skippedFiles.concat(relPath),
27+
skippedFiles: operation.state.skippedFiles.concat(absPath),
2728
})
2829
}
2930
}

0 commit comments

Comments
 (0)