File tree Expand file tree Collapse file tree 3 files changed +2
-9
lines changed Expand file tree Collapse file tree 3 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,6 @@ namespace Paths {
108
108
return fs::exists (path2) ? path2 : path1;
109
109
}
110
110
111
- fs::path getCanonicalPathIfExists (const std::string & filename) {
112
- fs::path p = fs::weakly_canonical (filename);
113
- return fs::exists (p) ? p : fs::path (filename);
114
- }
115
-
116
111
bool isPath (const std::string &possibleFilePath) noexcept {
117
112
try {
118
113
return fs::exists (possibleFilePath);
Original file line number Diff line number Diff line change @@ -181,7 +181,6 @@ namespace Paths {
181
181
}
182
182
183
183
fs::path getCCJsonFileFullPath (const std::string &filename, const fs::path &directory);
184
- fs::path getCanonicalPathIfExists (const std::string &filename);
185
184
186
185
bool isPath (const std::string &possibleFilePath) noexcept ;
187
186
// endregion
Original file line number Diff line number Diff line change @@ -681,7 +681,7 @@ namespace printer {
681
681
682
682
fs::path NativeMakefilePrinter::getRelativePath (fs::path source, bool isCanonical) const {
683
683
if (isCanonical) {
684
- source = Paths::getCanonicalPathIfExists (source);
684
+ source = fs::weakly_canonical (source);
685
685
}
686
686
687
687
for (const auto &[path, shellVariable] : pathToShellVariable) {
@@ -714,9 +714,8 @@ namespace printer {
714
714
std::function<void (const std::string&, const std::string&)> declareFunc,
715
715
bool shouldWriteToMap, bool isCanonical) {
716
716
const fs::path relativePath = getRelativePath (path, isCanonical);
717
- fs::path canonical = Paths::getCanonicalPathIfExists (path);
718
717
if (isCanonical) {
719
- path = canonical ;
718
+ path = fs::weakly_canonical (path) ;
720
719
}
721
720
declareFunc (variableName, relativePath.string ());
722
721
if (shouldWriteToMap) {
You can’t perform that action at this time.
0 commit comments