Skip to content
Merged
Changes from 1 commit
Commits
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
13 changes: 12 additions & 1 deletion src/task/task_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,18 @@ impl TaskExecutor {
) -> Result<()> {
let config = Config::get().await?;
let script = script.trim_start();
let cmd = format!("$ {script} {args}", args = args.join(" ")).to_string();
// For display, skip a leading shebang so the user sees the actual
// command instead of e.g. "#!/usr/bin/env bash".
let display_script = if script.starts_with("#!") {
script
.split_once('\n')
.map_or("", |(_, body)| body)
.trim_start()
} else {
script
};
let cmd =
format!("$ {display_script} {args}", args = args.join(" ")).to_string();
Comment thread
jdx marked this conversation as resolved.
Outdated
Comment thread
jdx marked this conversation as resolved.
Outdated
if !self.quiet(Some(task)) {
let msg = style::ebold(trunc(prefix, config.redact(&cmd).trim()))
.bright()
Expand Down
Loading