mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
which: Prefer FileSystem over DeprecatedFile
This commit is contained in:
parent
d04968fee4
commit
8c2cdb7bc7
2 changed files with 4 additions and 3 deletions
|
@ -145,6 +145,7 @@ target_link_libraries(userdel PRIVATE LibFileSystem)
|
||||||
target_link_libraries(wallpaper PRIVATE LibGfx LibGUI)
|
target_link_libraries(wallpaper PRIVATE LibGfx LibGUI)
|
||||||
target_link_libraries(wasm PRIVATE LibWasm LibLine LibJS)
|
target_link_libraries(wasm PRIVATE LibWasm LibLine LibJS)
|
||||||
target_link_libraries(watch PRIVATE LibFileSystem)
|
target_link_libraries(watch PRIVATE LibFileSystem)
|
||||||
|
target_link_libraries(which PRIVATE LibFileSystem)
|
||||||
target_link_libraries(wsctl PRIVATE LibGUI LibIPC)
|
target_link_libraries(wsctl PRIVATE LibGUI LibIPC)
|
||||||
target_link_libraries(xml PRIVATE LibXML)
|
target_link_libraries(xml PRIVATE LibXML)
|
||||||
target_link_libraries(xzcat PRIVATE LibCompress)
|
target_link_libraries(xzcat PRIVATE LibCompress)
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/DeprecatedFile.h>
|
|
||||||
#include <LibCore/System.h>
|
#include <LibCore/System.h>
|
||||||
|
#include <LibFileSystem/FileSystem.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.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.add_positional_argument(filename, "Name of executable", "executable");
|
||||||
args_parser.parse(arguments);
|
args_parser.parse(arguments);
|
||||||
|
|
||||||
auto fullpath = Core::DeprecatedFile::resolve_executable_from_environment(filename);
|
auto fullpath = FileSystem::resolve_executable_from_environment(filename);
|
||||||
if (!fullpath.has_value()) {
|
if (fullpath.is_error()) {
|
||||||
warnln("no '{}' in path", filename);
|
warnln("no '{}' in path", filename);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue