diff --git a/.changeset/late-fans-sort.md b/.changeset/late-fans-sort.md new file mode 100644 index 000000000..d6e376bac --- /dev/null +++ b/.changeset/late-fans-sort.md @@ -0,0 +1,5 @@ +--- +'@lagon/cli': minor +--- + +Rename `lagon undeploy` to `lagon rm` diff --git a/packages/cli/src/commands/mod.rs b/packages/cli/src/commands/mod.rs index e5522e330..183f81288 100644 --- a/packages/cli/src/commands/mod.rs +++ b/packages/cli/src/commands/mod.rs @@ -3,11 +3,11 @@ mod deploy; mod dev; mod login; mod logout; -mod undeploy; +mod rm; pub use build::build; pub use deploy::deploy; pub use dev::dev; pub use login::login; pub use logout::logout; -pub use undeploy::undeploy; +pub use rm::rm; diff --git a/packages/cli/src/commands/undeploy.rs b/packages/cli/src/commands/rm.rs similarity index 92% rename from packages/cli/src/commands/undeploy.rs rename to packages/cli/src/commands/rm.rs index 9e72cab31..e63ae9d20 100644 --- a/packages/cli/src/commands/undeploy.rs +++ b/packages/cli/src/commands/rm.rs @@ -18,7 +18,7 @@ struct DeleteFunctionRequest { #[derive(Deserialize, Debug)] struct DeleteFunctionResponse {} -pub async fn undeploy(file: PathBuf) -> Result<()> { +pub async fn rm(file: PathBuf) -> Result<()> { let config = Config::new()?; if config.token.is_none() { @@ -30,7 +30,7 @@ pub async fn undeploy(file: PathBuf) -> Result<()> { validate_code_file(&file)?; match get_function_config()? { - None => Err(anyhow!("No configuration found in this directory.")), + None => Err(anyhow!("No configuration found for this file.")), Some(function_config) => match Confirm::new() .with_prompt(info( "Are you sure you want to completely delete this Function?", diff --git a/packages/cli/src/main.rs b/packages/cli/src/main.rs index a8f582dec..2a095a181 100644 --- a/packages/cli/src/main.rs +++ b/packages/cli/src/main.rs @@ -46,9 +46,8 @@ enum Commands { #[clap(visible_alias = "production", long)] prod: bool, }, - /// Undeploy an existing Function - Undeploy { - /// Path to the file to undeploy + /// Delete an existing Function + Rm { #[clap(value_parser)] file: PathBuf, }, @@ -101,7 +100,7 @@ async fn main() { public_dir, prod, } => commands::deploy(file, client, public_dir, prod).await, - Commands::Undeploy { file } => commands::undeploy(file).await, + Commands::Rm { file } => commands::rm(file).await, Commands::Dev { file, client,