diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 9079887ebf..19ee1a8193 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -145,6 +145,7 @@ target_link_libraries(userdel PRIVATE LibFileSystem) target_link_libraries(wallpaper PRIVATE LibGfx LibGUI) target_link_libraries(wasm PRIVATE LibWasm LibLine LibJS) target_link_libraries(watch PRIVATE LibFileSystem) +target_link_libraries(which PRIVATE LibFileSystem) target_link_libraries(wsctl PRIVATE LibGUI LibIPC) target_link_libraries(xml PRIVATE LibXML) target_link_libraries(xzcat PRIVATE LibCompress) diff --git a/Userland/Utilities/which.cpp b/Userland/Utilities/which.cpp index c987a4d538..3407652cb2 100644 --- a/Userland/Utilities/which.cpp +++ b/Userland/Utilities/which.cpp @@ -5,8 +5,8 @@ */ #include -#include #include +#include #include #include @@ -20,8 +20,8 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(filename, "Name of executable", "executable"); args_parser.parse(arguments); - auto fullpath = Core::DeprecatedFile::resolve_executable_from_environment(filename); - if (!fullpath.has_value()) { + auto fullpath = FileSystem::resolve_executable_from_environment(filename); + if (fullpath.is_error()) { warnln("no '{}' in path", filename); return 1; }