Don't attempt to get the working directory of a URL

This commit is contained in:
Cameron Gutman 2024-02-04 20:58:38 -06:00
parent 0aa4f06c39
commit ee93890d86

View File

@ -118,7 +118,12 @@ namespace proc {
return boost::filesystem::path();
}
BOOST_LOG(debug) << "Parsed executable ["sv << parts.at(0) << "] from command ["sv << cmd << ']';
BOOST_LOG(debug) << "Parsed target ["sv << parts.at(0) << "] from command ["sv << cmd << ']';
// If the target is a URL, don't parse any further here
if (parts.at(0).find("://") != std::string::npos) {
return boost::filesystem::path();
}
// If the cmd path is not an absolute path, resolve it using our PATH variable
boost::filesystem::path cmd_path(parts.at(0));
@ -130,7 +135,7 @@ namespace proc {
}
}
BOOST_LOG(debug) << "Resolved executable ["sv << parts.at(0) << "] to path ["sv << cmd_path << ']';
BOOST_LOG(debug) << "Resolved target ["sv << parts.at(0) << "] to path ["sv << cmd_path << ']';
// Now that we have a complete path, we can just use parent_path()
return cmd_path.parent_path();