Skip to content

child_process calling bito returns empty #11

Open
@1226085293

Description

@1226085293

Can you tell me why this code doesn't work?

image

import child_process from "child_process";

const cmd = child_process.exec("bito -p I:/creator/gitbitoCLI/version-3.0/1.txt -f I:/creator/gitbitoCLI/version-3.0/2.txt", {
	cwd: "I:/creator/gitbitoCLI/version-3.0/",
	encoding: "utf8",
});

let result_s = "";

cmd.stdout!.on("data", (message: Buffer) => {
	result_s += message.toString();
});
const result = new Promise<string>((resolve_f) => {
	cmd.on("close", () => {
		console.log("result: ", result_s);
		resolve_f(result_s);
	});
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions