From f3ed90e4994f544e31660b7393a65f829ae84f6c Mon Sep 17 00:00:00 2001 From: Riyyi Date: Thu, 23 Sep 2021 17:30:01 +0200 Subject: [PATCH] Manager: Rename targets to paths --- src/dotfile.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dotfile.cpp b/src/dotfile.cpp index 6ef0d97..1d0a564 100644 --- a/src/dotfile.cpp +++ b/src/dotfile.cpp @@ -40,37 +40,37 @@ void Dotfile::add(const std::vector& targets) return; } - std::vector noExistTargets; - std::vector homeTargets; - std::vector systemTargets; + std::vector noExistPaths; + std::vector homePaths; + std::vector systemPaths; // Separate home and system targets for (size_t i = 0; i < targets.size(); ++i) { if (!std::filesystem::is_regular_file(targets.at(i)) && !std::filesystem::is_directory(targets.at(i)) && !std::filesystem::is_symlink(targets.at(i))) { - noExistTargets.push_back(i); + noExistPaths.push_back(i); continue; } if (isSystemTarget(targets.at(i))) { - systemTargets.push_back(i); + systemPaths.push_back(i); } else { - homeTargets.push_back(i); + homePaths.push_back(i); } } // Print non-existing targets and exit - if (!noExistTargets.empty()) { - for (size_t i : noExistTargets) { + if (!noExistPaths.empty()) { + for (size_t i : noExistPaths) { fprintf(stderr, "\033[31;1mDotfile:\033[0m '%s': no such file or directory\n", targets.at(i).c_str()); } return; } sync( - targets, homeTargets, systemTargets, + targets, homePaths, systemPaths, [](std::string* paths, std::string homePath, size_t homeSize) { paths[0] = homePath; paths[1] = homePath.substr(homeSize + 1);