diff --git a/Rocket.toml b/Rocket.toml index 0c73461..d5a7f04 100644 --- a/Rocket.toml +++ b/Rocket.toml @@ -8,6 +8,6 @@ port = 9346 # Uncomment to make it production like. #log_level = "critical" -source_root = "/net/nasx/mnt/storage/aoc/" +source_root = "/net/nasx/mnt/storage/aoc/github/" build_root = "/tmp/aocsync/" www_root = "/tmp/aocsync-serve/" diff --git a/src/main.rs b/src/main.rs index bc9a485..24f068e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,7 +139,7 @@ fn reload(config: &State, repo: &str) -> Result { info!("Creating {}", www_root.display()); fs::create_dir_all(&www_root)?; } - let mut output = Vec::new(); + let mut output = vec![logging_run(Command::new("git").arg("version"))?]; let needs_clone = !build_path.exists(); if needs_clone { output.push(logging_run( @@ -156,9 +156,10 @@ fn reload(config: &State, repo: &str) -> Result { .arg("-f") .arg("origin"), )?); + dbg!(&build_path); // Make sure buildable clone is up to date output.push(logging_run( - Command::new("git").current_dir(&build_path).arg("pull"), + Command::new("git").current_dir(&build_path).arg("fetch"), )?); let commits = logging_run(Command::new("git").current_dir(&build_path).args([ "log", @@ -191,7 +192,6 @@ fn reload(config: &State, repo: &str) -> Result { .map(|ts| format!("{}", format_task_status(ts))) .collect::>() .join("\n"); - info!("{}", response); Ok(response) } diff --git a/templates/index.html.tera b/templates/index.html.tera index f81c329..8725c3c 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -1,3 +1,4 @@ {% for d in dirs %} {% endfor %} +
Source in git.