fix revision check logic
This commit is contained in:
parent
e6b287d377
commit
2c2e78b56b
1 changed files with 8 additions and 1 deletions
|
@ -72,6 +72,8 @@ fn current_revision() -> Result<Revision, RevisionCheckError> {
|
|||
|
||||
let server_config_revision = toml::from_str::<Config>(&buffer)?.config_revision;
|
||||
|
||||
buffer.clear();
|
||||
|
||||
let mut client_toml = fs::File::open(CLIENT_CONFIG_PATH)?;
|
||||
client_toml.read_to_string(&mut buffer)?;
|
||||
|
||||
|
@ -83,7 +85,12 @@ fn current_revision() -> Result<Revision, RevisionCheckError> {
|
|||
));
|
||||
}
|
||||
|
||||
Ok(server_config_revision)
|
||||
match server_config_revision {
|
||||
Revision::V0 => Err(RevisionCheckError::UnknownRevision(
|
||||
"revision 0 does not exist",
|
||||
)),
|
||||
_ => Ok(server_config_revision),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn run(command: Commands) -> Result<(), ConfigError> {
|
||||
|
|
Loading…
Reference in a new issue