mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Set cwd of setup/update during start
This commit is contained in:
@@ -43,6 +43,11 @@ fn main() -> Result<()> {
|
||||
info!(" Debug: {:?}", debug);
|
||||
}
|
||||
|
||||
// change working directory to the containing directory of the exe
|
||||
let mut containing_dir = env::current_exe()?;
|
||||
containing_dir.pop();
|
||||
env::set_current_dir(containing_dir)?;
|
||||
|
||||
let res = commands::install(debug, installto);
|
||||
if let Err(e) = &res {
|
||||
error!("An error has occurred: {}", e);
|
||||
|
||||
@@ -90,6 +90,11 @@ fn main() -> Result<()> {
|
||||
info!(" Silent: {}", silent);
|
||||
info!(" Log File: {:?}", log_file);
|
||||
|
||||
// change working directory to the containing directory of the exe
|
||||
let mut containing_dir = env::current_exe()?;
|
||||
containing_dir.pop();
|
||||
env::set_current_dir(containing_dir)?;
|
||||
|
||||
let (subcommand, subcommand_matches) = matches.subcommand().ok_or_else(|| anyhow!("No subcommand was used. Try `--help` for more information."))?;
|
||||
let result = match subcommand {
|
||||
#[cfg(target_os = "windows")]
|
||||
|
||||
Reference in New Issue
Block a user