diff options
Diffstat (limited to '')
| -rw-r--r-- | src/yue.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/yue.cpp b/src/yue.cpp index 9ae4c3e..49fa3e1 100644 --- a/src/yue.cpp +++ b/src/yue.cpp | |||
| @@ -146,6 +146,9 @@ static std::string compileFile(const fs::path& srcFile, yue::YueConfig conf, con | |||
| 146 | (std::istreambuf_iterator<char>(input)), | 146 | (std::istreambuf_iterator<char>(input)), |
| 147 | std::istreambuf_iterator<char>()); | 147 | std::istreambuf_iterator<char>()); |
| 148 | auto modulePath = srcFile.lexically_relative(workPath); | 148 | auto modulePath = srcFile.lexically_relative(workPath); |
| 149 | if (modulePath.empty()) { | ||
| 150 | modulePath = srcFile; | ||
| 151 | } | ||
| 149 | conf.module = modulePath.string(); | 152 | conf.module = modulePath.string(); |
| 150 | if (!workPath.empty()) { | 153 | if (!workPath.empty()) { |
| 151 | auto it = conf.options.find("path"); | 154 | auto it = conf.options.find("path"); |
| @@ -205,7 +208,11 @@ public: | |||
| 205 | auto targetFile = getTargetFile(srcFile); | 208 | auto targetFile = getTargetFile(srcFile); |
| 206 | if (!targetFile.empty()) { | 209 | if (!targetFile.empty()) { |
| 207 | fs::remove(targetFile); | 210 | fs::remove(targetFile); |
| 208 | std::cout << "Deleted " << targetFile.lexically_relative(workPath).string() << '\n'; | 211 | auto moduleFile = targetFile.lexically_relative(workPath); |
| 212 | if (moduleFile.empty()) { | ||
| 213 | moduleFile = targetFile; | ||
| 214 | } | ||
| 215 | std::cout << "Deleted " << moduleFile.string() << '\n'; | ||
| 209 | } | 216 | } |
| 210 | break; | 217 | break; |
| 211 | } | 218 | } |
