From bb60b3ac391c9e018d521a1231c6f96e99005eb1 Mon Sep 17 00:00:00 2001 From: "Daniel Porteous (dport)" Date: Wed, 6 Mar 2024 16:18:50 +0000 Subject: [PATCH] Make install dir if not present in aptos update revela (#12401) --- Cargo.lock | 2 +- crates/aptos/CHANGELOG.md | 3 +++ crates/aptos/Cargo.toml | 2 +- crates/aptos/src/update/revela.rs | 8 +++++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfbd27e6e095b..c82a8a44ee695 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "aptos" -version = "3.0.0" +version = "3.0.1" dependencies = [ "anyhow", "aptos-api-types", diff --git a/crates/aptos/CHANGELOG.md b/crates/aptos/CHANGELOG.md index 34431db8a54e2..fe3b464cbec23 100644 --- a/crates/aptos/CHANGELOG.md +++ b/crates/aptos/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to the Aptos CLI will be captured in this file. This project ## Unreleased +## [3.0.1] - 2024/03/05 +- Fix bug in `aptos update revela` if default install directory doesn't exist. + ## [3.0.0] - 2024/03/05 - **Breaking Change**: `aptos update` is now `aptos update aptos`. - Added `aptos update revela`. This installs / updates the `revela` binary, which is needed for the new `aptos move decompile` subcommand. diff --git a/crates/aptos/Cargo.toml b/crates/aptos/Cargo.toml index 35b6c8813e435..de3ac63238bd0 100644 --- a/crates/aptos/Cargo.toml +++ b/crates/aptos/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "aptos" description = "Aptos tool for management of nodes and interacting with the blockchain" -version = "3.0.0" +version = "3.0.1" # Workspace inherited keys authors = { workspace = true } diff --git a/crates/aptos/src/update/revela.rs b/crates/aptos/src/update/revela.rs index 62f1a758ed628..3612ec5db0940 100644 --- a/crates/aptos/src/update/revela.rs +++ b/crates/aptos/src/update/revela.rs @@ -97,7 +97,13 @@ impl BinaryUpdater for RevelaUpdateTool { let install_dir = match self.install_dir.clone() { Some(dir) => dir, - None => get_additional_binaries_dir(), + None => { + let dir = get_additional_binaries_dir(); + // Make the directory if it doesn't already exist. + std::fs::create_dir_all(&dir) + .with_context(|| format!("Failed to create directory: {:?}", dir))?; + dir + }, }; let current_version = match &info.current_version {