-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nx-tools): add nx executor for running interactive commands
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tools/nx-tools/src/executors/run-interactive-command/executor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as execa from "execa"; | ||
|
||
export default async function buildExecutor(options: { | ||
command: string; | ||
cwd?: string; | ||
}) { | ||
console.info(`🟡 Executing workspace:run-command...`); | ||
|
||
await execa.command(options.command, { | ||
cwd: options.cwd, | ||
stdio: [process.stdin, process.stdout, "pipe"], | ||
}); | ||
|
||
console.info(`✅ Executing workspace:run-command finished!`); | ||
|
||
return { success: true }; | ||
} |
16 changes: 16 additions & 0 deletions
16
tools/nx-tools/src/executors/run-interactive-command/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema", | ||
"type": "object", | ||
"cli": "nx", | ||
"properties": { | ||
"command": { | ||
"type": "string", | ||
"description": "The command to run" | ||
}, | ||
"cwd": { | ||
"type": "string", | ||
"description": "The working directory to run the command in" | ||
} | ||
}, | ||
"required": ["command"] | ||
} |