Shell: Add support for inline environment variables

e.g. `foo=$(echo lol) Shell -c 'echo $foo'` will now print lol!
This commit is contained in:
2024-10-15 23:45:08 +03:00
parent 8317bb13ca
commit 6e981d1222
4 changed files with 85 additions and 4 deletions

View File

@@ -25,14 +25,23 @@ public:
private:
struct InternalCommand
{
using Command = BAN::Variant<Builtin::BuiltinCommand, BAN::String>;
enum class Type
{
Builtin,
External,
};
BAN::Variant<Builtin::BuiltinCommand, BAN::String> command;
struct Environment
{
BAN::String name;
BAN::String value;
};
Command command;
BAN::Span<const BAN::String> arguments;
BAN::Span<const Environment> environments;
int fd_in;
int fd_out;
bool background;