1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:07:36 +00:00

which: Prefer FileSystem over DeprecatedFile

This commit is contained in:
Ben Wiederhake 2023-05-13 00:07:13 +02:00 committed by Andreas Kling
parent d04968fee4
commit 8c2cdb7bc7
2 changed files with 4 additions and 3 deletions

View file

@ -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)

View file

@ -5,8 +5,8 @@
*/
#include <LibCore/ArgsParser.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/System.h>
#include <LibFileSystem/FileSystem.h>
#include <stdio.h>
#include <unistd.h>
@ -20,8 +20,8 @@ ErrorOr<int> 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;
}