public Codebase edit(Codebase input, ProjectContext context, Map<String, String> options) {
File tempDir = AppContext.RUN.fileSystem.getTemporaryDirectory("shell_run_");
try {
Utils.copyDirectory(input.getPath(), tempDir);
} catch (IOException e) {
throw new MoeProblem(e.getMessage());
} catch (CommandRunner.CommandException e) {
throw new MoeProblem(e.getMessage());
}
try {
AppContext.RUN.cmd.runCommand("bash", ImmutableList.of("-c", this.commandString),
tempDir.getAbsolutePath());
} catch (CommandRunner.CommandException e) {
throw new MoeProblem(e.getMessage());
}
return new Codebase(tempDir, input.getProjectSpace(), input.getExpression());
}