Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

Commit 3df8f04

Browse files
committed
skip succes crates
1 parent 1231768 commit 3df8f04

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Diff for: src/main.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use std::{
1111
use clap::Parser;
1212
use csv::ReaderBuilder;
1313
use regex::Regex;
14+
use sea_orm::{ActiveModelTrait, ColumnTrait, DatabaseConnection, EntityTrait, QueryFilter};
1415
use sea_orm::{ActiveValue::NotSet, ConnectOptions, Database, IntoActiveModel, Set};
15-
use sea_orm::{ColumnTrait, DatabaseConnection, EntityTrait, QueryFilter, ActiveModelTrait};
1616
use tracing::log;
1717
use url::Url;
1818
use walkdir::WalkDir;
@@ -107,7 +107,11 @@ pub async fn add_and_push_to_remote(workspace: PathBuf) {
107107
updated_at: Set(chrono::Utc::now().naive_utc()),
108108
}
109109
} else {
110-
model.unwrap().into_active_model()
110+
let res = model.unwrap();
111+
if res.status == RepoSyncStatus::Succeed {
112+
continue;
113+
}
114+
res.into_active_model()
111115
};
112116
let mut capture = re.captures_iter(&stdout);
113117
if let Some(capture) = capture.next() {
@@ -138,7 +142,12 @@ pub async fn add_and_push_to_remote(workspace: PathBuf) {
138142
.output()
139143
.unwrap();
140144
let push_res = Command::new("git").arg("push").arg("nju").output().unwrap();
141-
Command::new("git").arg("push").arg("nju").arg("--tags").output().unwrap();
145+
Command::new("git")
146+
.arg("push")
147+
.arg("nju")
148+
.arg("--tags")
149+
.output()
150+
.unwrap();
142151

143152
if push_res.status.success() {
144153
record.status = Set(RepoSyncStatus::Succeed);

0 commit comments

Comments
 (0)