Skip to content

Commit 19dc19d

Browse files
committed
Merge branch 'feature/monorepo' into development
2 parents 90950db + 80e99f8 commit 19dc19d

File tree

7 files changed

+13
-4
lines changed

7 files changed

+13
-4
lines changed

crates/cli/src/deploy/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub(crate) async fn get_config(
4949
let config: Config = match toml::from_str(&config_content) {
5050
Ok(value) => value,
5151
Err(e) => {
52-
println!("{}", e);
52+
println!("Error parsing config: {}", e);
5353
spinner.stop_and_persist(&fail_symbol(), fail_message("Config unsync."));
5454
handle_config_error()?
5555
}

crates/cli/src/deploy/detect_runner.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ use {
22
crate::ui::{fail_message, fail_symbol, succeed_message, succeed_symbol},
33
anyhow::Result,
44
smbcloud_model::runner::Runner,
5+
smbcloud_utils::config::Config,
56
spinners::Spinner,
67
std::{env::current_dir, path::Path},
78
};
89

9-
pub(crate) async fn detect_runner() -> Result<Runner> {
10+
pub(crate) async fn detect_runner(config: &Config) -> Result<Runner> {
1011
let mut spinner: Spinner = Spinner::new(
1112
spinners::Spinners::SimpleDotsScrolling,
1213
succeed_message("Checking runner"),
@@ -24,6 +25,11 @@ pub(crate) async fn detect_runner() -> Result<Runner> {
2425
);
2526
}
2627
};
28+
29+
// See if we have a monorepo setup.
30+
if config.project.runner == Runner::Monorepo && config.projects.is_some() {
31+
return Ok(Runner::Monorepo);
32+
}
2733
let runner = match Runner::from(&path) {
2834
Ok(runner) => runner,
2935
Err(_) => {

crates/cli/src/deploy/process_deploy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub async fn process_deploy(env: Environment) -> Result<CommandResult> {
4242
let config = get_config(env, Some(&access_token)).await?;
4343

4444
// Check runner.
45-
let runner = detect_runner().await?;
45+
let runner = detect_runner(&config).await?;
4646

4747
// Validate config with project.
4848
check_project(env, &access_token, config.project.id).await?;

crates/cli/src/deploy/setup_project.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pub(crate) async fn setup_project(
7272
project,
7373
name,
7474
description,
75+
projects: None,
7576
};
7677

7778
// Ensure .smb directory exists

crates/smbcloud-model/src/project.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub struct Project {
1919
pub id: i32,
2020
pub name: String,
2121
pub runner: Runner,
22+
pub path: Option<String>,
2223
pub repository: Option<String>,
2324
pub description: Option<String>,
2425
pub created_at: DateTime<Utc>,

crates/smbcloud-model/src/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use {
99
},
1010
};
1111

12-
#[derive(Debug, Deserialize_repr, Serialize_repr, Clone, Copy)]
12+
#[derive(Debug, Deserialize_repr, Serialize_repr, Clone, Copy, PartialEq)]
1313
#[repr(u8)]
1414
#[tsync::tsync]
1515
pub enum Runner {

crates/smbcloud-utils/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub struct Config {
99
pub name: String,
1010
pub description: Option<String>,
1111
pub project: Project,
12+
pub projects: Option<Vec<Project>>,
1213
}
1314

1415
impl Config {

0 commit comments

Comments
 (0)