Skip to content

Commit

Permalink
Add wasmer publish command
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Dec 12, 2022
1 parent 2dec532 commit b993321
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ enum WasmerCLIOptions {
/// Login into a wapm.io-like registry
Login(Login),

/// Login into a wapm.io-like registry
#[clap(name = "publish")]
Publish(Publish),

/// Wasmer cache
#[clap(subcommand)]
Cache(Cache),
Expand Down Expand Up @@ -172,6 +176,7 @@ impl WasmerCLIOptions {
Self::Init(init) => init.execute(),
Self::List(list) => list.execute(),
Self::Login(login) => login.execute(),
Self::Publish(publish) => publish.execute(),
#[cfg(feature = "wast")]
Self::Wast(wast) => wast.execute(),
#[cfg(target_os = "linux")]
Expand Down
1 change: 1 addition & 0 deletions lib/cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod init;
mod inspect;
mod list;
mod login;
mod publish;
mod run;
mod self_update;
mod validate;
Expand Down
20 changes: 20 additions & 0 deletions lib/cli/src/commands/publish.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use clap::Parser;

/// CLI options for the `wasmer publish` command
#[derive(Debug, Parser)]
pub struct Publish {
/// Directory containing the `wapm.toml` (defaults to current root dir)
#[clap(long, name = "dir", env = "DIR")]
pub dir: Option<String>,
/// Registry to publish to
#[clap(long, name = "registry")]
pub registry: Option<String>,
}

impl Publish {
/// Executes `wasmer publish`
pub fn execute(&self) -> Result<(), anyhow::Error> {
println!("{:?}", self);
Ok(())
}
}

0 comments on commit b993321

Please sign in to comment.