3 files changed
+12
-5
crates/cli/src/deploy/setup.rs
+10
-3
@@ -1,4 +1,7 @@
1
-use crate::{deploy::config::{Config, ConfigError}, ui::highlight};
1
+use crate::{
2
+ deploy::config::{Config, ConfigError},
3
+ ui::highlight,
4
+};
5
use dialoguer::{theme::ColorfulTheme, Confirm, Input, Select};
6
use regex::Regex;
7
use smbcloud_model::project::{Project, ProjectCreate};
@@ -56,7 +59,11 @@ pub async fn setup_project(env: Environment) -> Result<Config, ConfigError> {
59
Ok(config)
60
}
61
59
-async fn select_project(env: Environment, projects: Vec<Project>, path: &str) -> Result<Project, ConfigError> {
62
+async fn select_project(
63
+ env: Environment,
64
+ projects: Vec<Project>,
65
+ path: &str,
66
+) -> Result<Project, ConfigError> {
67
let confirm = Confirm::with_theme(&ColorfulTheme::default())
68
.with_prompt("Use existing project? y/n")
69
.interact()
@@ -97,7 +104,7 @@ async fn create_new_project(env: Environment, path: &str) -> Result<Project, Con
104
let re = Regex::new(r"[^a-zA-Z0-9_-]").unwrap();
105
let default_repository = name.clone().to_lowercase().replace(' ', "_");
106
let default_repo = re.replace_all(&default_repository, "");
100
-
107
+
108
let repository = match Input::<String>::with_theme(&ColorfulTheme::default())
109
.default(default_repo.to_string())
110
.with_prompt("Repository")
crates/cli/src/main.rs
+1
-1
@@ -117,6 +117,6 @@ async fn run() -> Result<CommandResult> {
117
Some(Commands::Login {}) => process_login(cli.environment).await,
118
Some(Commands::Logout {}) => process_logout(cli.environment).await,
119
Some(Commands::Project { command }) => process_project(cli.environment, command).await,
120
- None => { process_deploy(cli.environment).await }
120
+ None => process_deploy(cli.environment).await,
121
}
122
}
crates/cli/src/ui/mod.rs
+1
-1
@@ -18,4 +18,4 @@ pub fn fail_message(message: &str) -> String {
18
19
pub fn highlight(string: &str) -> String {
20
style(string).italic().green().to_string()
21
-}
\ No newline at end of file
21
+}