Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Fisher <[email protected]>
  • Loading branch information
bacongobbler committed Jun 23, 2023
1 parent b81816d commit 504edae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
15 changes: 7 additions & 8 deletions src/commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,8 @@ impl DeployCommand {
// via only `add_revision` if bindle naming schema is updated so bindles can be deterministically ordered by Cloud.
let channel_id = match self.get_app_id_cloud(&client, name.clone()).await {
Ok(app_id) => {
Client::add_revision(
&client,
name.clone(),
bindle_id.version_string().clone(),
)
.await?;
Client::add_revision(&client, name.clone(), bindle_id.version_string().clone())
.await?;
let existing_channel_id = self
.get_channel_id_cloud(&client, SPIN_DEPLOY_CHANNEL_NAME.to_string(), app_id)
.await?;
Expand All @@ -197,7 +193,7 @@ impl DeployCommand {
None,
Some(active_revision_id),
None,
None
None,
)
.await
.context("Problem patching a channel")?;
Expand Down Expand Up @@ -587,7 +583,10 @@ pub async fn login_connection(deployment_env_id: Option<&str>) -> Result<LoginCo
Some(name) => {
// TODO: allow auto redirect to login preserving the name
eprintln!("You have no instance saved as '{}'", name);
eprintln!("Run `spin platform login --environment-name {}` to log in", name);
eprintln!(
"Run `spin platform login --environment-name {}` to log in",
name
);
std::process::exit(1);
}
None => {
Expand Down
13 changes: 6 additions & 7 deletions src/commands/login.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::io::Write;
use std::io::stdin;
use std::io::Write;
use std::path::PathBuf;

use anyhow::{bail, Context, Result};
Expand All @@ -10,10 +10,10 @@ use serde::Serialize;
use tracing::log;
use url::Url;


use crate::opts::{
PLATFORM_SERVER_URL_OPT, PLATFORM_URL_ENV, DEPLOYMENT_ENV_NAME_ENV, INSECURE_OPT, SPIN_AUTH_TOKEN, HIPPO_USERNAME, HIPPO_PASSWORD, BINDLE_SERVER_URL_OPT, BINDLE_URL_ENV, BINDLE_USERNAME, BINDLE_PASSWORD,
TOKEN,
BINDLE_PASSWORD, BINDLE_SERVER_URL_OPT, BINDLE_URL_ENV, BINDLE_USERNAME,
DEPLOYMENT_ENV_NAME_ENV, HIPPO_PASSWORD, HIPPO_USERNAME, INSECURE_OPT, PLATFORM_SERVER_URL_OPT,
PLATFORM_URL_ENV, SPIN_AUTH_TOKEN, TOKEN,
};

const DEFAULT_PLATFORM_URL: &str = "https://127.0.0.1:5309/";
Expand Down Expand Up @@ -115,7 +115,7 @@ pub struct LoginCommand {
name = "list",
long = "list",
takes_value = false,
conflicts_with = "environment-name",
conflicts_with = "environment-name"
)]
pub list: bool,
}
Expand All @@ -136,8 +136,7 @@ fn parse_url(url: &str) -> Result<url::Url> {

impl LoginCommand {
pub async fn run(&self) -> Result<()> {
if self.list
{
if self.list {
self.run_list().await?
}

Expand Down

0 comments on commit 504edae

Please sign in to comment.