Commit 3b6fae85 authored by AdamSimpson's avatar AdamSimpson
Browse files

script doesn't like stdin being closed or single quotes around the command

parent 2a91db1c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -37,11 +37,11 @@ int main(int argc, char *argv[]) {
        // We use "script" to fake the build into thinking it has a real TTY, which the command output eventually will
        // This causes things like wget and color ls to work nicely
        // TODO : perhaps set TERM as well to something like xterm ?
        std::string build_command("/usr/bin/sudo /usr/bin/script -q -e -c '/usr/local/bin/singularity build ./container.img ./container.def' /dev/null");
        std::string build_command("/usr/bin/sudo /usr/bin/script -f -q -e -c \"/usr/local/bin/singularity build ./container.img ./container.def\" /dev/null");

        bp::group group;
        std::error_code build_ec;
        bp::child build_child(build_command, bp::std_in.close(), (bp::std_out & bp::std_err) > std_pipe, group, build_ec);
        bp::child build_child(build_command, (bp::std_out & bp::std_err) > std_pipe, group, build_ec);
        if(build_ec) {
            logger::write("subprocess error: " + build_ec.message());
        }