1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 07:07:34 +00:00

Shell: Add create() factory function for PathRedirection

This commit is contained in:
Andreas Kling 2020-08-12 12:15:30 +02:00
parent e8d665337a
commit 85b02d887b
2 changed files with 11 additions and 5 deletions

View file

@ -1261,7 +1261,7 @@ RefPtr<Value> ReadRedirection::run(RefPtr<Shell> shell)
StringBuilder builder;
builder.join(" ", path_segments);
command.redirections.append(adopt(*new PathRedirection(builder.to_string(), m_fd, PathRedirection::Read)));
command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::Read));
return create<CommandValue>(move(command));
}
@ -1288,7 +1288,7 @@ RefPtr<Value> ReadWriteRedirection::run(RefPtr<Shell> shell)
StringBuilder builder;
builder.join(" ", path_segments);
command.redirections.append(adopt(*new PathRedirection(builder.to_string(), m_fd, PathRedirection::ReadWrite)));
command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::ReadWrite));
return create<CommandValue>(move(command));
}
@ -1781,7 +1781,7 @@ RefPtr<Value> WriteAppendRedirection::run(RefPtr<Shell> shell)
StringBuilder builder;
builder.join(" ", path_segments);
command.redirections.append(adopt(*new PathRedirection(builder.to_string(), m_fd, PathRedirection::WriteAppend)));
command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::WriteAppend));
return create<CommandValue>(move(command));
}
@ -1808,7 +1808,7 @@ RefPtr<Value> WriteRedirection::run(RefPtr<Shell> shell)
StringBuilder builder;
builder.join(" ", path_segments);
command.redirections.append(adopt(*new PathRedirection(builder.to_string(), m_fd, PathRedirection::Write)));
command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::Write));
return create<CommandValue>(move(command));
}