Skip to content

Commit c859c44

Browse files
committed
Fix compile error on msvc, cast std::filesystem::path to std::string
1 parent c06b27e commit c859c44

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/luaumb.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ int main(int argc, char** argv) {
5656
if (configs.find(config_file_relative_path) == configs.end()) {
5757
Luau::Config config;
5858

59-
std::filesystem::path config_file_path = module_path.path;
60-
config_file_path.replace_filename(Luau::kConfigName);
61-
6259
std::filesystem::path relative = module_path.relative.parent_path().parent_path();
6360
while (relative.string() != "/") {
6461
const auto it = configs.find(relative.string());
@@ -70,14 +67,7 @@ int main(int argc, char** argv) {
7067
}
7168
}
7269

73-
if (std::filesystem::exists(config_file_path.string())) {
74-
std::optional<std::string> config_file = readFile(config_file_path);
75-
76-
if (!config_file) {
77-
std::cout << "Couldn't read config " << module_path.path << std::endl;
78-
return 1;
79-
}
80-
70+
if (std::optional<std::string> config_file = readFile(module_path.path.replace_filename(Luau::kConfigName).string())) {
8171
Luau::ConfigOptions config_option = {false, std::optional<Luau::ConfigOptions::AliasOptions>({config_file_relative_path, true})};
8272
std::optional<std::string> error = Luau::parseConfig(*config_file, config, config_option);
8373

0 commit comments

Comments
 (0)