Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

child_process calling bito returns empty #11

Open
1226085293 opened this issue May 10, 2023 · 2 comments
Open

child_process calling bito returns empty #11

1226085293 opened this issue May 10, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@1226085293
Copy link

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);
	});
});
@minghua-li
Copy link

官方应该不推荐这样使用cli吧?否则也不会用Ctrl D(也就是EOF,这是一个无法用程序模拟提交到控制台的快捷键)做提交了.你这个问题大概是因为bito第一次使用的时候需要用邮箱验证,你可以试试先用对应的用户做一下验证,生成~/.bito的目录,然后再用程序跑跑看.

@macky3099
Copy link
Collaborator

macky3099 commented May 12, 2023

Hi @1226085293,

We did try to reproduce the issue you are facing. Although it dint give the expected output but it was able to make validations as you might see in the screenshots attached below. So you shouldn't at least get an empty result. Check if your path or filename were correct.

We will look in to this issue of why it isn't giving an expected output and just keeps waiting.

Screenshot

Thanks,

@macky3099 macky3099 added the bug Something isn't working label Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants