Skip to content

Commit

Permalink
feat: Add serial mode with single root job (#120)
Browse files Browse the repository at this point in the history
* feat: serial_mode with single root job

* exit on task failure

* ops module

* Remove unnecessary params

* refactor: add exec_builder to CommandActor

* feat: fewer fields in CommandActor
  • Loading branch information
Natoandro authored Feb 7, 2024
1 parent 7703d73 commit a7f16df
Show file tree
Hide file tree
Showing 12 changed files with 633 additions and 417 deletions.
222 changes: 67 additions & 155 deletions src/actors/command.rs

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/actors/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ use ignore::gitignore::GitignoreBuilder;
use notify::event::ModifyKind;
use notify::{recommended_watcher, Event, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
use std::collections::HashSet;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::sync::Arc;

use super::command::{CommandActor, Reload};

pub struct WatcherActor {
watcher: Option<RecommendedWatcher>,
globs: Vec<WatchGlob>,
base_dir: PathBuf,
base_dir: Arc<Path>,
// List of file paths to ignore on the watcher
ignore: HashSet<PathBuf>,
}

impl WatcherActor {
pub fn new(base_dir: PathBuf) -> Self {
pub fn new(base_dir: Arc<Path>) -> Self {
Self {
watcher: None,
globs: Vec::default(),
Expand Down
9 changes: 9 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ pub struct Graph {
pub boxed: bool,
}

#[derive(Parser, Debug, Clone)]
pub struct Execute {
#[arg()]
pub task: String,
}

/// Set of subcommands.
#[derive(Subcommand, Debug)]
pub enum Command {
Expand All @@ -27,6 +33,9 @@ pub enum Command {
Graph(Graph),
/// List all the jobs set in the config file
ListJobs,
/// Execute a specific job; running its dependencies serially
#[command(name = "x")]
Execute(Execute),
}

#[derive(Parser, Debug)]
Expand Down
Loading

0 comments on commit a7f16df

Please sign in to comment.