Skip to content

Commit

Permalink
Merge pull request #991 from tjkirch/updata-fail-missing-manifest
Browse files Browse the repository at this point in the history
updata add-update: don't create manifest, require 'init' first
  • Loading branch information
tjkirch authored Jul 14, 2020
2 parents a29a145 + e3ad928 commit 94b5329
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sources/updater/update_metadata/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub enum Error {
backtrace: Backtrace,
},

#[snafu(display("Failed to read manifest file {}: {}", path.display(), source))]
#[snafu(display("Failed to read manifest file '{}' - do you need to `updata init`? ({})", path.display(), source))]
ManifestRead {
path: PathBuf,
source: std::io::Error,
Expand Down
6 changes: 1 addition & 5 deletions sources/updater/updog/src/bin/updata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ struct AddUpdateArgs {

impl AddUpdateArgs {
fn run(self) -> Result<()> {
let mut manifest: Manifest = match update_metadata::load_file(&self.file) {
Ok(m) => m,
_ => Manifest::default(), // TODO only if EEXIST
};

let mut manifest: Manifest = update_metadata::load_file(&self.file)?;
manifest.add_update(
self.image_version,
self.max_version,
Expand Down

0 comments on commit 94b5329

Please sign in to comment.