提交 c484d0c4 编写于 作者: B Benjamin Pasero 提交者: GitHub

Merge pull request #22907 from wabirached/hotfix/correctly-duplicate-files-with-numbers-in-filename

Correctly duplicate files with numbers in filename
......@@ -1099,8 +1099,8 @@ export class DuplicateFileAction extends BaseFileAction {
private toCopyName(name: string, isFolder: boolean): string {
// file.1.txt=>file.2.txt
if (!isFolder && name.match(/(\d+)(\..*)$/)) {
return name.replace(/(\d+)(\..*)$/, (match, g1?, g2?) => { return (parseInt(g1) + 1) + g2; });
if (!isFolder && name.match(/(.*\.)(\d+)(\..*)$/)) {
return name.replace(/(.*\.)(\d+)(\..*)$/, (match, g1?, g2?, g3?) => { return g1 + (parseInt(g2) + 1) + g3; });
}
// file.txt=>file.1.txt
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册