Skip to content

Commit

Permalink
feat(cli): rename lagon undeploy to lagon rm (#273)
Browse files Browse the repository at this point in the history
* feat(cli): rename `lagon undeploy` to `lagon rm`

* fix: build errors
  • Loading branch information
QuiiBz authored Nov 23, 2022
1 parent e380812 commit c146417
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-fans-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lagon/cli': minor
---

Rename `lagon undeploy` to `lagon rm`
4 changes: 2 additions & 2 deletions packages/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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?",
Expand Down
7 changes: 3 additions & 4 deletions packages/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c146417

Please sign in to comment.