Skip to content

Commit

Permalink
WASM paths are now relative to the manifest path.
Browse files Browse the repository at this point in the history
As is right and proper.
  • Loading branch information
ceejbot committed Feb 3, 2023
1 parent 45aa4f3 commit 56fdfbf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cli/src/main.rs
Expand Up @@ -20,6 +20,7 @@ use uuid::Uuid;
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
use std::path::Path;
use std::path::PathBuf;
use std::sync::Mutex;
use std::time::Duration;
Expand Down Expand Up @@ -90,8 +91,14 @@ fn upload_manifest(manifest_path: PathBuf) -> Result<()> {
println!("Reading manifest: {}", manifest_path.display());
let manifest = Manifest::from_file(&manifest_path)?;

println!("Reading WASM executable:{}", manifest.binary().display());
let executable = read_file(manifest.binary().to_path_buf())?;
let mut wasmpath = manifest_path
.parent()
.unwrap_or_else(|| Path::new("."))
.to_path_buf();
wasmpath.push(manifest.binary());

This comment has been minimized.

Copy link
@shinypb

shinypb Feb 3, 2023

Contributor

Nice and succinct! (I confirmed for my own edification that pushing an absolute path does the right thing. Rust is so great.)


println!("Reading WASM executable:{}", wasmpath.display());
let executable = read_file(wasmpath)?;

let client = reqwest::blocking::Client::builder()
.timeout(Duration::from_secs(60))
Expand Down

0 comments on commit 56fdfbf

Please sign in to comment.