Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: Use a PATH based approach for task execution. #1208

Merged
merged 36 commits into from
Dec 9, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ed4591d
new: Rework `moon init` command. (#1204)
milesj Nov 26, 2023
9723863
Add paths.
milesj Nov 27, 2023
496821c
Add new methods.
milesj Nov 27, 2023
e0fd05e
Update deno.
milesj Nov 27, 2023
f6f3bef
Update bun.
milesj Nov 27, 2023
876057c
Update deno.
milesj Nov 27, 2023
1c06de1
Update rust.
milesj Nov 27, 2023
ae3ec94
Update node.
milesj Nov 27, 2023
102da33
Add target paths.
milesj Nov 27, 2023
7ed0d2f
Add env vars.
milesj Nov 27, 2023
4b4cbcd
Update bin.
milesj Nov 27, 2023
caa882f
Rework vars.
milesj Nov 27, 2023
04be376
Avoid latest version.
milesj Nov 27, 2023
bb608c6
Fix tests.
milesj Nov 28, 2023
09add02
Update docs.
milesj Nov 28, 2023
6f11fd2
Install proto.
milesj Nov 28, 2023
a155947
Polish consts.
milesj Nov 28, 2023
c56538f
Update lookup paths.
milesj Nov 28, 2023
fae001f
Always use a shell.
milesj Nov 28, 2023
b43d28d
Remove shell from vcs.
milesj Nov 28, 2023
320c750
Copy bin.
milesj Nov 28, 2023
4d82f85
Polish.
milesj Dec 8, 2023
dbecad5
Fix workspace.
milesj Dec 8, 2023
6f1d6f7
Fixes.
milesj Dec 8, 2023
739aa9a
Disable proto for tests.
milesj Dec 8, 2023
33bdbc3
Only run on linux.
milesj Dec 8, 2023
579d40c
Start on blog post.
milesj Dec 8, 2023
1ce1fac
Fix windows shell.
milesj Dec 8, 2023
77b0a03
Fix tests.
milesj Dec 8, 2023
507c21c
More fixes.
milesj Dec 8, 2023
4e44706
More fixes.
milesj Dec 9, 2023
b23d291
Fix format.
milesj Dec 9, 2023
896eb94
Update docs.
milesj Dec 9, 2023
8e3ca18
Fallback to a version.
milesj Dec 9, 2023
10598ab
Remove snapshot.
milesj Dec 9, 2023
04ea54f
Update proto config.
milesj Dec 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix windows shell.
milesj committed Dec 8, 2023
commit 1ce1fac977785870aa328389735f961e285dc9e4
4 changes: 2 additions & 2 deletions nextgen/process/src/shell.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cached::proc_macro::cached;
use std::{env, ffi::OsStr};
use std::ffi::OsStr;

#[cached]
#[inline]
@@ -52,7 +52,7 @@ pub fn create_shell() -> Shell {
#[inline]
pub fn create_shell() -> Shell {
Shell {
bin: env::var("SHELL").unwrap_or_else(|_| "/bin/sh".into()),
bin: std::env::var("SHELL").unwrap_or_else(|_| "/bin/sh".into()),
args: vec!["-c".into()],
pass_args_stdin: false,
}
7 changes: 5 additions & 2 deletions nextgen/task-builder/src/tasks_builder.rs
Original file line number Diff line number Diff line change
@@ -461,8 +461,11 @@ impl<'proj> TasksBuilder<'proj> {
TaskType::Test
};

if task.platform.is_system() && task.options.shell.is_none() {
task.options.shell = Some(true);
if task.options.shell.is_none() {
// Windows requires a shell for path resolution to work correctly
if cfg!(windows) || task.platform.is_system() {
task.options.shell = Some(true);
}
}

Ok(task)
11 changes: 8 additions & 3 deletions nextgen/task-builder/tests/tasks_builder_test.rs
Original file line number Diff line number Diff line change
@@ -586,9 +586,14 @@ mod tasks_builder {
// True for system
assert_eq!(tasks.get("system").unwrap().options.shell, Some(true));

// None for others
assert_eq!(tasks.get("bun").unwrap().options.shell, None);
assert_eq!(tasks.get("node").unwrap().options.shell, None);
// None for others (except windows)
if cfg!(windows) {
assert_eq!(tasks.get("bun").unwrap().options.shell, Some(true));
assert_eq!(tasks.get("node").unwrap().options.shell, Some(true));
} else {
assert_eq!(tasks.get("bun").unwrap().options.shell, None);
assert_eq!(tasks.get("node").unwrap().options.shell, None);
}
}
}

2 changes: 1 addition & 1 deletion website/docs/config/project.mdx
Original file line number Diff line number Diff line change
@@ -952,7 +952,7 @@ tasks:

<HeadingApiLink to="/api/types/interface/TaskOptionsConfig#shell" />

Whether to run the command within a shell or not. Defaults to `true` for system platform, and
Whether to run the command within a shell or not. Defaults to `true` for system platform or Windows, and
`false` otherwise.

- On Unix, will derive the shell from the `SHELL` environment variable, or default to `/bin/sh`. The