Skip to content

Commit

Permalink
verbose railway up flag (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup authored Jun 3, 2024
1 parent f77214e commit e3a9df0
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/commands/up.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ pub struct Args {
#[clap(long)]
/// Don't ignore paths from .gitignore
no_gitignore: bool,

#[clap(long)]
/// Verbose output
verbose: bool,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -239,12 +243,23 @@ pub async fn command(args: Args, _json: bool) -> Result<()> {
}
parz.finish()?;

let builder = client.post(format!(
let url = format!(
"https://backboard.{hostname}/project/{}/environment/{}/up?serviceId={}",
linked_project.project,
environment_id,
service.unwrap_or_default(),
));
service.clone().unwrap_or_default(),
);

if args.verbose {
let bytes_len = arc.lock().unwrap().len();
println!("railway up");
println!("service: {}", service.clone().unwrap_or_default());
println!("environment: {}", environment_id);
println!("bytes: {}", bytes_len);
println!("url: {}", url);
}

let builder = client.post(url);
let spinner = if std::io::stdout().is_terminal() {
let spinner = ProgressBar::new_spinner()
.with_style(
Expand Down

0 comments on commit e3a9df0

Please sign in to comment.