diff --git a/src/deltas.rs b/src/deltas.rs index 8f44348..112d31f 100644 --- a/src/deltas.rs +++ b/src/deltas.rs @@ -27,7 +27,7 @@ fn main() -> Result<()> { let mut conf = Config::from_file(&args.config)?; init_logger(conf.general.log_level.as_str()); - conf.validate(true)?; + conf.validate(true, false)?; let mut gen = Generator::init(&conf, false); info!("Running generator..."); gen.create_patches().context("Creating delta patches failed!")?; diff --git a/src/models/config.rs b/src/models/config.rs index 5dc3f7d..01c8a00 100644 --- a/src/models/config.rs +++ b/src/models/config.rs @@ -302,10 +302,10 @@ impl Config { self.package.updater.notes_file = fs::canonicalize(notes_file)?; } - self.validate(false) + self.validate(false, args.packaging_only) } - pub fn validate(&mut self, deltas_only: bool) -> Result<()> { + pub fn validate(&mut self, deltas_only: bool, packaging_only: bool) -> Result<()> { // Output folder cannot be checked as it may not exist yet match fs::canonicalize(&self.env.input_dir) { Ok(res) => self.env.input_dir = res, @@ -341,8 +341,12 @@ impl Config { // Check file paths (for binaries, also check if they are in %PATH%) misc::check_binary_path(&mut self.env.pdbcopy_path)?; misc::check_binary_path(&mut self.env.makensis_path)?; - misc::check_binary_path(&mut self.env.sevenzip_path)?; - misc::check_binary_path(&mut self.env.pandoc_path)?; + if !self.package.zip.skip { + misc::check_binary_path(&mut self.env.sevenzip_path)?; + } + if !packaging_only { + misc::check_binary_path(&mut self.env.pandoc_path)?; + } // Check if private key is set correctly (if signing is enabled) if !self.package.updater.skip_sign { @@ -394,6 +398,10 @@ impl Config { bail!("NSIS script does not exist!") } + if packaging_only { + return Ok(()); + } + // Check that notes and vc redist files exists if !self.package.updater.vc_redist_path.exists() { bail!(