From 650a32d82704b17d1423f309aaf532e1c4a42388 Mon Sep 17 00:00:00 2001 From: Langning Chen Date: Sat, 23 Dec 2023 20:26:00 +0800 Subject: [PATCH] Refactor file renaming logic --- .github/workflows/{cmake-single-platform.yml => cmake.yml} | 4 ++-- main.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) rename .github/workflows/{cmake-single-platform.yml => cmake.yml} (91%) diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake.yml similarity index 91% rename from .github/workflows/cmake-single-platform.yml rename to .github/workflows/cmake.yml index e61618f..79981a1 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake.yml @@ -1,4 +1,4 @@ -name: CMake on a single platform +name: CMake on: push: branches: [ "main" ] @@ -18,5 +18,5 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: build + name: MultiRename.exe path: ${{github.workspace}}\build\Release\MultiRename.exe \ No newline at end of file diff --git a/main.cpp b/main.cpp index aa56d5c..d419d71 100644 --- a/main.cpp +++ b/main.cpp @@ -41,7 +41,7 @@ bool operator==(FILE_INFO a, FILE_INFO b) } std::string CurrentDir = "C:"; -std::string Pattern = "[F]"; +std::string Pattern = "[D]/[F]"; std::vector FilesToRename; std::vector>> Indexes; @@ -433,9 +433,7 @@ std::string ProceedRename(const FILE_INFO &File) else Position++; } - if (NewName.length() > 32) - NewName = "Name too long"; - return File.Directory + "/" + NewName; + return NewName; } void Rename() {