Skip to content

Commit

Permalink
feat: pass current command into task run context
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Nov 11, 2024
1 parent a78f030 commit 0591035
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/cli/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function runTasksFromConfig(logger: Logger, config: ValidConfig, co
for (const task of tasks) {
try {
logger.info(styles.taskHeader(`running ${styles.task(task.id)} task`))
await task.run({ files })
await task.run({ files, command })
} catch (error) {
// if there's an exit code, that's a request from the task to exit early
if (error instanceof ToolKitError && error.exitCode) {
Expand Down
1 change: 1 addition & 0 deletions lib/base/src/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type Default<T, D> = T extends undefined ? D : T

export type TaskRunContext = {
files?: string[]
command: string
}

export abstract class Task<
Expand Down

0 comments on commit 0591035

Please sign in to comment.