@smbcloud / cli / commits / 5cf8db0

use dynamic project name

Seto Elkahfi committed May 24, 2025 at 12:37 UTC 5cf8db0ff4f1f3f2dc86aad66e2ab7973805bf15
3 files changed +12 -3
crates/cli/src/deploy/config.rs
+1 -1
@@ -66,7 +66,7 @@ impl Config {
66 .join(".ssh")
67 .join(format!("id_{}@smbcloud.xyz", self.name));
68 let key_path_str = key_path.to_string_lossy().to_string();
69 - // println!("Use key path: {}", key_path_str);
69 + println!("Use key path: {}", key_path_str);
70 key_path_str
71 }
72 }
crates/cli/src/deploy/mod.rs
+4 -2
@@ -1,6 +1,7 @@
1 mod config;
2 mod git;
3 mod remote_url;
4 +mod remote_messages;
5
6 use crate::{
7 account::lib::protected_request,
@@ -11,6 +12,7 @@ use anyhow::{anyhow, Result};
12 use config::check_config;
13 use git::remote_deployment_setup;
14 use git2::{PushOptions, RemoteCallbacks, Repository};
15 +use remote_messages::{build_next_app, start_server};
16 use smbcloud_networking::environment::Environment;
17 use spinners::Spinner;
18
@@ -50,10 +52,10 @@ pub async fn process_deploy(env: Environment) -> Result<CommandResult> {
52 // Convert bytes to string, print line by line
53 if let Ok(text) = std::str::from_utf8(data) {
54 for line in text.lines() {
53 - if line.contains("> next build") {
55 + if line.contains(&build_next_app()) {
56 println!("Building the app {}", succeed_symbol());
57 }
56 - if line.contains("Start hagerstenstreetcut") {
58 + if line.contains(&start_server(&config.name)) {
59 println!("Restarting the server {}", succeed_symbol());
60 }
61 }
crates/cli/src/deploy/remote_messages.rs new
+7
@@ -0,0 +1,7 @@
1 +pub fn build_next_app() -> String {
2 + "> next build".to_owned()
3 +}
4 +
5 +pub fn start_server(name: &str) -> String {
6 + format!("Start {}", name)
7 +}
\ No newline at end of file