Skip to content

Commit be3d7fb

Browse files
committed
feat: add grunt
1 parent 28b6ee4 commit be3d7fb

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

src/keeper.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,24 @@ pub fn list_all_runner_tasks(
295295
}
296296
}
297297
}
298+
if runners::gruntfile::is_available() {
299+
if runners::gruntfile::is_command_available() {
300+
if let Ok(runner_tasks) = runners::gruntfile::list_tasks() {
301+
if !runner_tasks.is_empty() {
302+
all_tasks.insert("grunt".to_string(), runner_tasks);
303+
}
304+
}
305+
} else {
306+
if error_display {
307+
println!(
308+
"{}",
309+
"[tk] grunt(https://gruntjs.com/) command not available for Gruntfile.js"
310+
.bold()
311+
.red()
312+
);
313+
}
314+
}
315+
}
298316
if runners::taskfileyml::is_available() {
299317
if runners::taskfileyml::is_command_available() {
300318
if let Ok(runner_tasks) = runners::taskfileyml::list_tasks() {

src/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,15 @@ fn diagnose() {
400400
);
401401
}
402402
}
403+
if runners::gruntfile::is_available() {
404+
if !runners::gruntfile::is_command_available() {
405+
problems_count += 1;
406+
println!(
407+
"{} grunt(https://gruntjs.com/) command not available for Gruntfile.js",
408+
"Warning:".bold().yellow()
409+
);
410+
}
411+
}
403412
if runners::taskfileyml::is_available() {
404413
if !runners::taskfileyml::is_command_available() {
405414
problems_count += 1;

src/runners/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub mod xtask_go;
2525
pub mod zed;
2626
pub mod jakefile;
2727
pub mod gulpfile;
28+
pub mod gruntfile;
2829

2930
use crate::command_utils::CommandOutput;
3031
use crate::errors::KeeperError;
@@ -36,6 +37,7 @@ pub const RUNNERS: &'static [&'static str] = &[
3637
"rake",
3738
"jake",
3839
"gulp",
40+
"grunt",
3941
"invoke",
4042
"task",
4143
"cargo-make",
@@ -85,6 +87,7 @@ pub fn run_task(
8587
"rake" => rakefile::run_task(task_name, task_args, global_args, verbose),
8688
"jake" => jakefile::run_task(task_name, task_args, global_args, verbose),
8789
"gulp" => gulpfile::run_task(task_name, task_args, global_args, verbose),
90+
"grunt" => gruntfile::run_task(task_name, task_args, global_args, verbose),
8891
"task" => taskfileyml::run_task(task_name, task_args, global_args, verbose),
8992
"invoke" => taskspy::run_task(task_name, task_args, global_args, verbose),
9093
"cargo-make" => makefiletoml::run_task(task_name, task_args, global_args, verbose),
@@ -113,6 +116,7 @@ pub fn get_runner_file_name(runner: &str) -> &'static str {
113116
"rake" => "Rakefile",
114117
"jake" => "jakefile.js",
115118
"gulp" => "gulpfile.js",
119+
"grunt" => "Gruntfile.js",
116120
"invoke" => "tasks.py",
117121
"task" => "Taskfile.yml",
118122
"cargo-make" => "Makefile.toml",
@@ -145,6 +149,7 @@ pub fn get_runner_web_url(runner: &str) -> &'static str {
145149
"rake" => "https://ruby.github.io/rake/",
146150
"jake" => "https://jakejs.com/",
147151
"gulp" => "https://gulpjs.com/",
152+
"grunt" => "https://gruntjs.com/",
148153
"invoke" => "https://www.pyinvoke.org",
149154
"task" => "https://taskfile.dev",
150155
"cargo-make" => "https://github.com/sagiegurari/cargo-make",

0 commit comments

Comments
 (0)