Shell: Add create() factory function for PathRedirection

This commit is contained in:
Andreas Kling 2020-08-12 12:15:30 +02:00
commit 85b02d887b
Notes: sideshowbarker 2024-07-19 03:43:48 +09:00
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));
}