Skip to content

Commit

Permalink
[cli] Fix cli client publish path (MystenLabs#17749)
Browse files Browse the repository at this point in the history
## Description 

Fixes the issue with providing a path to a Move project with `sui client
publish <path>`, and failing to find the directory.

## Test plan 

Existing tests. Manual checks
```bash
~/src/sui/examples > sui client publish move/first_package 
~/src/sui/examples/move > sui client publish first_package 
~/src/sui/examples/move/first_package > sui client publish . 
```
---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
stefan-mysten authored May 15, 2024
1 parent 1c4dbbe commit efd50a3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/sui/src/client_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,12 @@ impl SuiClientCommands {
let sender = context.try_get_object_owner(&opts.gas).await?;
let sender = sender.unwrap_or(context.active_address()?);
let client = context.get_client().await?;
let package_path =
package_path
.canonicalize()
.map_err(|e| SuiError::ModulePublishFailure {
error: format!("Failed to canonicalize package path: {}", e),
})?;
let (package_id, compiled_modules, dependencies, package_digest, upgrade_policy) =
upgrade_package(
client.read_api(),
Expand Down Expand Up @@ -931,6 +937,12 @@ impl SuiClientCommands {
let sender = context.try_get_object_owner(&opts.gas).await?;
let sender = sender.unwrap_or(context.active_address()?);
let client = context.get_client().await?;
let package_path =
package_path
.canonicalize()
.map_err(|e| SuiError::ModulePublishFailure {
error: format!("Failed to canonicalize package path: {}", e),
})?;
let (dependencies, compiled_modules, _, _) = compile_package(
client.read_api(),
build_config.clone(),
Expand Down

0 comments on commit efd50a3

Please sign in to comment.