[ImpellerC] Print the working directory that was tried when failing to open (flutter/engine#38079)

* Resolve language before working directory, print the working directory that was tried

* Quotes
This commit is contained in:
Brandon DeRosier 2022-12-05 13:27:49 -08:00 committed by GitHub
parent 0485c8e365
commit 8f398c03bd

View File

@ -130,10 +130,6 @@ Switches::Switches(const fml::CommandLine& command_line)
"0"))),
entry_point(
command_line.GetOptionValueWithDefault("entry-point", "main")) {
if (!working_directory || !working_directory->is_valid()) {
return;
}
auto language =
command_line.GetOptionValueWithDefault("source-language", "glsl");
std::transform(language.begin(), language.end(), language.begin(),
@ -144,6 +140,10 @@ Switches::Switches(const fml::CommandLine& command_line)
source_language = SourceLanguage::kHLSL;
}
if (!working_directory || !working_directory->is_valid()) {
return;
}
for (const auto& include_dir_path : command_line.GetOptionValues("include")) {
if (!include_dir_path.data()) {
continue;
@ -196,7 +196,9 @@ bool Switches::AreValid(std::ostream& explain) const {
}
if (!working_directory || !working_directory->is_valid()) {
explain << "Could not figure out working directory." << std::endl;
explain << "Could not open the working directory: \""
<< Utf8FromPath(std::filesystem::current_path()).c_str() << "\""
<< std::endl;
valid = false;
}