cli: Do not serialize empty workspace (#559)

This commit is contained in:
Kirill Fomichev 2021-07-29 00:04:36 +03:00 committed by GitHub
parent 03042590a9
commit ba6e15d557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -190,7 +190,8 @@ impl ToString for Config {
false => Some(self.scripts.clone()),
},
clusters,
workspace: Some(self.workspace.clone()),
workspace: (!self.workspace.members.is_empty() || !self.workspace.exclude.is_empty())
.then(|| self.workspace.clone()),
};
toml::to_string(&cfg).expect("Must be well formed")