package lc.mecha.exec;

import java.io.IOException;
import java.io.OutputStream;


public class ScriptTask implements BatchTask {
    private final String script;
    private String result;

    public ScriptTask(String script) {
        this.script = script;
    }

    /**
     * Write the script representing this task to the given output stream.
     */
    @Override
    public void writeScript(OutputStream os) throws IOException {
        os.write(script.getBytes());
    }

    @Override
    public void finished(String result) {
        this.result = result;
    }

    public String getResult() {
        return result;
    }
}
