Skip to content

Commit 80a2612

Browse files
committed
add command output
1 parent 14790eb commit 80a2612

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,19 @@ pub fn git_add_commit_files(files: Vec<String>) {
256256

257257
pub fn add_and_commit(file: &str) {
258258
Command::new("git").arg("add").arg(file).output().unwrap();
259-
Command::new("git")
259+
let output = Command::new("git")
260260
.arg("commit")
261261
.arg("-m")
262262
.arg(file)
263263
.output()
264264
.unwrap();
265+
266+
println!("{}", String::from_utf8(output.stdout).unwrap());
265267
}
266268

267269
pub fn push_to_origin() {
268-
Command::new("git").arg("push").output().unwrap();
270+
let output = Command::new("git").arg("push").output().unwrap();
271+
println!("{}", String::from_utf8(output.stdout).unwrap());
269272
}
270273

271274
/// 通过题目名获取rust答题模板

0 commit comments

Comments
 (0)