File tree Expand file tree Collapse file tree 2 files changed +0
-117
lines changed
Expand file tree Collapse file tree 2 files changed +0
-117
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import { HardhatPluginError } from "hardhat/plugins" ;
2-
31export const PLUGIN_NAME = "hardhat-plugin-noir" ;
4-
5- export const makeRunCommand = ( cwd ?: string ) => async ( command : string ) => {
6- const { exec } = await import ( "child_process" ) ;
7- const { promisify } = await import ( "util" ) ;
8- const execAsync = promisify ( exec ) ;
9- // TODO(security): escape command arguments (use template strings)
10- try {
11- const { stdout, stderr } = await execAsync ( command , {
12- cwd,
13- maxBuffer : Infinity ,
14- } ) ;
15- if ( stdout ) {
16- console . log ( stdout ) ;
17- }
18- if ( stderr ) {
19- console . error ( stderr ) ;
20- }
21- } catch ( error ) {
22- console . error ( `Error executing command: ${ command } ` ) ;
23- console . error ( ( error as any ) . stderr || ( error as any ) . message ) ; // Log only error messages
24- throw new HardhatPluginError (
25- PLUGIN_NAME ,
26- `Error executing command: ${ command } ` ,
27- ) ;
28- }
29- } ;
You can’t perform that action at this time.
0 commit comments