Skip to content

Commit 4c2c2cf

Browse files
committed
added back dry run fix
1 parent 19edc4f commit 4c2c2cf

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

crates/wasm-pkg-client/src/local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl PackagePublisher for LocalBackend {
140140
let mut out = tokio::fs::File::create(&path)
141141
.await
142142
.map_err(|e| registry_path_context(e, &path))?;
143-
println!("writing to {}", path.display());
143+
tracing::info!("publishing to {}", path.display());
144144
tokio::io::copy(&mut data, &mut out)
145145
.await
146146
.map_err(Error::IoError)

crates/wasm-pkg-common/src/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::{
44
path::{Path, PathBuf},
55
};
66

7-
use ::toml::Value;
87
use serde::{Deserialize, Serialize};
98

109
use crate::{

crates/wkg/src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,16 @@ impl PublishArgs {
273273
wit::build_wit_dir(&self.path, client.clone(), &mut lock_file).await?;
274274
// There is no way to check if we are in a git repository unlike `cargo publish --allow-dirty` so
275275
// check against previous values.
276-
if lock_file != prev_lock_ref {
276+
if lock_file != prev_lock_ref && !self.dry_run {
277277
return Err(anyhow::anyhow!(
278278
"wkg.lock would be updated during publish, aborting"
279279
))
280-
.context("Run `wkg wit fetch` before attempting to publish");
280+
.with_context(|| {
281+
format!(
282+
"Run `wkg wit build {}` before attempting to publish",
283+
self.path.to_string_lossy()
284+
)
285+
});
281286
}
282287

283288
let tmp = tempfile::Builder::new()

crates/wkg/src/wit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl BuildArgs {
115115
pub async fn build_wit_dir(
116116
dir: impl AsRef<Path>,
117117
client: CachingClient<FileCache>,
118-
mut lock_file: &mut LockFile,
118+
lock_file: &mut LockFile,
119119
) -> anyhow::Result<(PackageRef, Option<Version>, Vec<u8>)> {
120120
check_dir(&dir).await?;
121121
let wkg_config = wasm_pkg_core::config::Config::load().await?;

0 commit comments

Comments
 (0)