@@ -67,7 +67,7 @@ export const handler = async (args: yargs.Arguments): Promise<any> => {
6767 } else {
6868 interactive = true ;
6969 }
70-
70+
7171 const buildDir = SimbaConfig . buildDirectory ;
7272 SimbaConfig . log . debug ( `buildDir: ${ buildDir } ` ) ;
7373 let files : string [ ] = [ ] ;
@@ -122,9 +122,11 @@ export const handler = async (args: yargs.Arguments): Promise<any> => {
122122 // use sourceCodeComparer to prevent export of contracts that
123123 // do not have any changes:
124124 const exportStatuses = await sourceCodeComparer . exportStatuses ( choices ) ;
125+ const successfulExportMessage = `${ chalk . greenBright ( `Successfully exported` ) } ` ;
125126
126127 let currentContractName ;
127128 if ( ! primary ) {
129+ const attemptedExports : Record < any , any > = { } ;
128130 let chosen : Record < string , Array < any > > ;
129131 if ( interactive ) {
130132 chosen = await prompt ( {
@@ -156,18 +158,17 @@ export const handler = async (args: yargs.Arguments): Promise<any> => {
156158 const nonLibsArray = [ ] ;
157159 for ( let i = 0 ; i < chosen . contracts . length ; i ++ ) {
158160 const contractName = chosen . contracts [ i ] ;
161+ attemptedExports [ contractName ] = exportStatuses [ contractName ] ;
159162 if ( supplementalInfo [ contractName ] . contractType === "library" ) {
160163 libsArray . push ( contractName ) ;
161164 } else {
162165 nonLibsArray . push ( contractName ) ;
163166 }
164167 }
165168 const allContracts = libsArray . concat ( nonLibsArray ) ;
166- const attemptedExports : Record < any , any > = { } ;
167169 for ( let i = 0 ; i < allContracts . length ; i ++ ) {
168170 const singleContractImportData = { } as any ;
169171 currentContractName = allContracts [ i ] ;
170- attemptedExports [ currentContractName ] = exportStatuses [ currentContractName ] ;
171172 if ( ! exportStatuses [ currentContractName ] . newOrChanged ) {
172173 continue ;
173174 }
@@ -200,6 +201,7 @@ export const handler = async (args: yargs.Arguments): Promise<any> => {
200201 }
201202
202203 if ( resp . id ) {
204+ attemptedExports [ currentContractName ] . message = successfulExportMessage ;
203205 SimbaConfig . log . debug ( `entering id exists logic` ) ;
204206 const contractType = supplementalInfo [ currentContractName ] . contractType ;
205207 SimbaConfig . log . debug ( `contractType: ${ contractType } ` ) ;
@@ -214,8 +216,9 @@ export const handler = async (args: yargs.Arguments): Promise<any> => {
214216 source_code : sourceCode ,
215217 }
216218 SimbaConfig . ProjectConfigStore . set ( "contracts_info" , contractsInfo ) ;
217- SimbaConfig . log . info ( `${ chalk . cyanBright ( `\nsimba: Saved Contract ${ chalk . greenBright ( `${ currentContractName } ` ) } to Design ID ` ) } ${ chalk . greenBright ( `${ resp . id } ` ) } ` ) ;
219+ SimbaConfig . log . info ( `${ chalk . cyanBright ( `\nsimba: Successful Export! Saved Contract ${ chalk . greenBright ( `${ currentContractName } ` ) } to Design ID ` ) } ${ chalk . greenBright ( `${ resp . id } ` ) } ` ) ;
218220 } else {
221+ attemptedExports [ currentContractName ] = exportStatuses [ currentContractName ] ;
219222 SimbaConfig . log . error ( `${ chalk . red ( '\nsimba: EXIT : Error exporting contract to SIMBA Chain' ) } ` ) ;
220223 return ;
221224 }
0 commit comments