aboutsummaryrefslogtreecommitdiff
path: root/src/yue.cpp
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-11-15 18:25:30 +0800
committerLi Jin <dragon-fly@qq.com>2022-11-15 18:25:30 +0800
commit7ecfd8f02bad9ebba7e32894da278a48ef9ecee9 (patch)
tree2eeb69433051637b9090a5833718408eb32fa5f6 /src/yue.cpp
parent94f8330613877b3582d32bd11abd83a97b4399ad (diff)
downloadyuescript-7ecfd8f02bad9ebba7e32894da278a48ef9ecee9.tar.gz
yuescript-7ecfd8f02bad9ebba7e32894da278a48ef9ecee9.tar.bz2
yuescript-7ecfd8f02bad9ebba7e32894da278a48ef9ecee9.zip
fix issues detected by MSVC.
Diffstat (limited to 'src/yue.cpp')
-rw-r--r--src/yue.cpp9
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 }