Skip to content

Commit

Permalink
fix(poetry): Fix existing range unions (#19785)
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Philippsen <nils@redhat.com>
  • Loading branch information
nphilipp committed Jan 11, 2023
1 parent de289bb commit 1991b7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/modules/versioning/poetry/index.spec.ts
Expand Up @@ -226,6 +226,7 @@ describe('modules/versioning/poetry/index', () => {
${'~1.2'} | ${'replace'} | ${'1.2.3'} | ${'2.0.0'} | ${'~2.0'}
${'~1'} | ${'replace'} | ${'1.2.3'} | ${'2.0.0'} | ${'~2'}
${'^2.2'} | ${'widen'} | ${'2.2.0'} | ${'3.0.0'} | ${'^2.2 || ^3.0.0'}
${'^2.2 || ^3.0.0'} | ${'widen'} | ${'3.0.0'} | ${'4.0.0'} | ${'^2.2 || ^3.0.0 || ^4.0.0'}
${'^3.5'} | ${'pin'} | ${'3.5'} | ${'3.5'} | ${'3.5'}
`(
'getNewValue("$currentValue", "$rangeStrategy", "$currentVersion", "$newVersion") === "$expected"',
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/poetry/transform.ts
Expand Up @@ -144,5 +144,5 @@ export function npm2poetry(range: string): string {
res.splice(i, 2, newValue);
}
}
return res.join(', ').replace(/\s*,?\s*\|\|\s*,?\s*/, ' || ');
return res.join(', ').replace(/\s*,?\s*\|\|\s*,?\s*/g, ' || ');
}

0 comments on commit 1991b7f

Please sign in to comment.