File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -52,21 +52,14 @@ async function main() {
5252 // Parse constructor args
5353 let constructorArgs ;
5454 try {
55- // Remove any surrounding quotes, whitespace, and control characters
56- let cleanedJson = constructorArgsJson . trim ( ) ;
57- // Remove surrounding quotes (single or double)
58- cleanedJson = cleanedJson . replace ( / ^ [ ' " ] | [ ' " ] $ / g, '' ) ;
59- // Remove any trailing whitespace or control characters
60- cleanedJson = cleanedJson . replace ( / [ \s \r \n ] + $ / , '' ) ;
61-
62- logger . info ( `Parsing constructor args: ${ cleanedJson } ` ) ;
63- logger . info ( `Constructor args length: ${ cleanedJson . length } ` ) ;
55+ // Clean the JSON string (handles both workflow and local usage)
56+ const cleanedJson = constructorArgsJson
57+ . trim ( ) // Remove leading/trailing whitespace
58+ . replace ( / ^ [ ' " ] | [ ' " ] $ / g, '' ) ; // Remove surrounding quotes from .env parsing
6459
6560 constructorArgs = JSON . parse ( cleanedJson ) . map ( ( arg : string ) => AztecAddress . fromString ( arg ) ) ;
6661 } catch ( error ) {
67- logger . error ( `Failed to parse constructor args` ) ;
68- logger . error ( `Raw value: ${ JSON . stringify ( constructorArgsJson ) } ` ) ;
69- logger . error ( `Raw value length: ${ constructorArgsJson . length } ` ) ;
62+ logger . error ( `Failed to parse constructor args: ${ constructorArgsJson } ` ) ;
7063 logger . error ( `Error: ${ error } ` ) ;
7164 throw error ;
7265 }
You can’t perform that action at this time.
0 commit comments