README and panic on no versions

This commit is contained in:
Dan Ballard 2022-04-21 17:24:42 -07:00
parent 10682a6f99
commit aac555867e
2 changed files with 7 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# Cwtch Update Bot
- Creates a persistent profile in ~/.cwtch/bots/update_bot
- Servers the latest version of cwtch from the directory `cwtch_dist`

View File

@ -41,6 +41,9 @@ impl UpdateBot {
versions_dirs.push(path);
}
}
if versions_dirs.len() == 0 {
panic!("no cwtch versions detected in {}!", DIST_DIR)
}
versions_dirs.sort();
println!("sorted vd: {:?}", versions_dirs);
let latest_version = versions_dirs[versions_dirs.len() - 1].clone();