mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:57:34 +00:00
LibCore: Migrate Command from Deprecated{File,String}
This gives us free error-propagation in Core::command(...) and HackStudio::ProjectBuilder::for_each_library_dependencies. The comment about "String will be in the null state" has been misleading for a long time, so it is removed.
This commit is contained in:
parent
07dd719e3e
commit
f9a24eb7eb
4 changed files with 16 additions and 20 deletions
|
@ -6,19 +6,18 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <spawn.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
// If the executed command fails, the returned String will be in the null state.
|
||||
|
||||
struct CommandResult {
|
||||
int exit_code { 0 };
|
||||
DeprecatedString output;
|
||||
DeprecatedString error;
|
||||
ByteBuffer output;
|
||||
ByteBuffer error;
|
||||
};
|
||||
|
||||
ErrorOr<CommandResult> command(DeprecatedString const& program, Vector<DeprecatedString> const& arguments, Optional<LexicalPath> chdir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue