Minor tweaks.

This commit is contained in:
Bill Thiede 2022-12-04 09:35:00 -08:00
parent 842fd4bdd6
commit 28e430c8cf
3 changed files with 5 additions and 4 deletions

View File

@ -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/"

View File

@ -139,7 +139,7 @@ fn reload(config: &State<Config>, repo: &str) -> Result<String, SyncError> {
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<Config>, repo: &str) -> Result<String, SyncError> {
.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<Config>, repo: &str) -> Result<String, SyncError> {
.map(|ts| format!("{}", format_task_status(ts)))
.collect::<Vec<_>>()
.join("\n");
info!("{}", response);
Ok(response)
}

View File

@ -1,3 +1,4 @@
{% for d in dirs %}
<div><a href="/results/{{ d }}/report/">{{ d }}</a></div>
{% endfor %}
<div>Source in <a href="https://git.z.xinu.tv/wathiede/aocsync">git.</a>