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

Commit

Permalink
skip succes crates
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-747 committed May 20, 2024
1 parent 1231768 commit 3df8f04
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use std::{
use clap::Parser;
use csv::ReaderBuilder;
use regex::Regex;
use sea_orm::{ActiveModelTrait, ColumnTrait, DatabaseConnection, EntityTrait, QueryFilter};
use sea_orm::{ActiveValue::NotSet, ConnectOptions, Database, IntoActiveModel, Set};
use sea_orm::{ColumnTrait, DatabaseConnection, EntityTrait, QueryFilter, ActiveModelTrait};
use tracing::log;
use url::Url;
use walkdir::WalkDir;
Expand Down Expand Up @@ -107,7 +107,11 @@ pub async fn add_and_push_to_remote(workspace: PathBuf) {
updated_at: Set(chrono::Utc::now().naive_utc()),
}
} else {
model.unwrap().into_active_model()
let res = model.unwrap();
if res.status == RepoSyncStatus::Succeed {
continue;
}
res.into_active_model()
};
let mut capture = re.captures_iter(&stdout);
if let Some(capture) = capture.next() {
Expand Down Expand Up @@ -138,7 +142,12 @@ pub async fn add_and_push_to_remote(workspace: PathBuf) {
.output()
.unwrap();
let push_res = Command::new("git").arg("push").arg("nju").output().unwrap();
Command::new("git").arg("push").arg("nju").arg("--tags").output().unwrap();
Command::new("git")
.arg("push")
.arg("nju")
.arg("--tags")
.output()
.unwrap();

if push_res.status.success() {
record.status = Set(RepoSyncStatus::Succeed);
Expand Down

0 comments on commit 3df8f04

Please sign in to comment.