Skip to content

Commit

Permalink
feat(cli/deploy): Add --path flag
Browse files Browse the repository at this point in the history
  • Loading branch information
xdoardo authored and theduke committed Jun 18, 2024
1 parent 9e67a55 commit 1712c5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/cli/src/commands/app/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ the app:\n"
non_interactive: self.non_interactive,
publish_package: true,
dir: self.app_dir_path.clone(),
path: None,
no_wait: self.no_wait,
no_default: false,
no_persist_id: false,
Expand Down
12 changes: 10 additions & 2 deletions lib/cli/src/commands/app/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ pub struct CmdAppDeploy {
#[clap(long)]
pub dir: Option<PathBuf>,

/// The path to the `app.yaml` file.
#[clap(long, conflicts_with = "dir")]
pub path: Option<PathBuf>,

/// Do not wait for the app to become reachable.
#[clap(long)]
pub no_wait: bool,
Expand Down Expand Up @@ -226,7 +230,11 @@ impl AsyncCliCommand for CmdAppDeploy {
let client =
login_user(&self.api, &self.env, !self.non_interactive, "deploy an app").await?;

let base_dir_path = self.dir.clone().unwrap_or(std::env::current_dir()?);
let base_dir_path = self
.dir
.clone()
.unwrap_or(self.path.clone().unwrap_or(std::env::current_dir()?));

let (app_config_path, base_dir_path) = {
if base_dir_path.is_file() {
(
Expand Down Expand Up @@ -508,7 +516,7 @@ impl AsyncCliCommand for CmdAppDeploy {
// If the config changed, write it back.
if new_app_config != app_config {
// We want to preserve unknown fields to allow for newer app.yaml
// settings without requring new CLI versions, so instead of just
// settings without requiring new CLI versions, so instead of just
// serializing the new config, we merge it with the old one.
let new_merged = crate::utils::merge_yaml_values(
&app_config.clone().to_yaml_value()?,
Expand Down

0 comments on commit 1712c5d

Please sign in to comment.