@@ -95,13 +95,10 @@ export class DatacodeBinaryExecutor {
9595 timeout : 30_000 ,
9696 } ) ;
9797
98- // Parse created files from output if available
99- const filesCreated : string [ ] = [ ] ;
100- const filePattern = / C r e a t e d (?: f i l e | d i r e c t o r y ) : ( .+ ) / g;
101- let match ;
102- while ( ( match = filePattern . exec ( stdout ) ) !== null ) {
103- filesCreated . push ( match [ 1 ] ) ;
104- }
98+ // Parse the template directory from init output
99+ // Python CLI outputs: "Copying template to <dir>"
100+ const copyMatch = / C o p y i n g t e m p l a t e t o ( .+ ) / . exec ( stdout ) ;
101+ const filesCreated = copyMatch ? [ copyMatch [ 1 ] . trim ( ) ] : undefined ;
105102
106103 return {
107104 stdout : stdout . trim ( ) ,
@@ -159,26 +156,11 @@ export class DatacodeBinaryExecutor {
159156 timeout : 60_000 ,
160157 } ) ;
161158
162- // Parse scan results from output
163- const permissions : string [ ] = [ ] ;
164- const requirements : string [ ] = [ ] ;
159+ // Parse scanned files from output
160+ // Python CLI outputs: "Scanning <file>..."
165161 const filesScanned : string [ ] = [ ] ;
166-
167- // Parse permissions (expected format: "Permission required: <permission>")
168- const permissionPattern = / P e r m i s s i o n r e q u i r e d : ( .+ ) / g;
162+ const filePattern = / S c a n n i n g ( .+ ) \. \. \. / g;
169163 let match ;
170- while ( ( match = permissionPattern . exec ( stdout ) ) !== null ) {
171- permissions . push ( match [ 1 ] . trim ( ) ) ;
172- }
173-
174- // Parse requirements (expected format: "Dependency found: <requirement>")
175- const requirementPattern = / D e p e n d e n c y f o u n d : ( .+ ) / g;
176- while ( ( match = requirementPattern . exec ( stdout ) ) !== null ) {
177- requirements . push ( match [ 1 ] . trim ( ) ) ;
178- }
179-
180- // Parse scanned files (expected format: "Scanned: <file>")
181- const filePattern = / S c a n n e d : ( .+ ) / g;
182164 while ( ( match = filePattern . exec ( stdout ) ) !== null ) {
183165 filesScanned . push ( match [ 1 ] . trim ( ) ) ;
184166 }
@@ -187,8 +169,6 @@ export class DatacodeBinaryExecutor {
187169 stdout : stdout . trim ( ) ,
188170 stderr : stderr . trim ( ) ,
189171 workingDirectory : workingDir ,
190- permissions : permissions . length > 0 ? permissions : undefined ,
191- requirements : requirements . length > 0 ? requirements : undefined ,
192172 filesScanned : filesScanned . length > 0 ? filesScanned : undefined ,
193173 } ;
194174 } catch ( error ) {
@@ -224,36 +204,9 @@ export class DatacodeBinaryExecutor {
224204 timeout : 120_000 ,
225205 } ) ;
226206
227- // Parse archive path from output
228- let archivePath : string | undefined ;
229- const archivePathPattern = / A r c h i v e c r e a t e d : ( .+ \. z i p ) / i;
230- const archiveMatch = archivePathPattern . exec ( stdout ) ;
231- if ( archiveMatch ) {
232- archivePath = archiveMatch [ 1 ] . trim ( ) ;
233- }
234-
235- // Parse file count from output
236- let fileCount : number | undefined ;
237- const fileCountPattern = / ( \d + ) f i l e s ? (?: a d d e d | i n c l u d e d | a r c h i v e d ) / i;
238- const countMatch = fileCountPattern . exec ( stdout ) ;
239- if ( countMatch ) {
240- fileCount = parseInt ( countMatch [ 1 ] , 10 ) ;
241- }
242-
243- // Parse archive size from output
244- let archiveSize : string | undefined ;
245- const sizePattern = / A r c h i v e s i z e : ( .+ ) / i;
246- const sizeMatch = sizePattern . exec ( stdout ) ;
247- if ( sizeMatch ) {
248- archiveSize = sizeMatch [ 1 ] . trim ( ) ;
249- }
250-
251207 return {
252208 stdout : stdout . trim ( ) ,
253209 stderr : stderr . trim ( ) ,
254- archivePath,
255- fileCount,
256- archiveSize,
257210 } ;
258211 } catch ( error ) {
259212 const spawnError = error as SpawnError ;
@@ -368,36 +321,9 @@ export class DatacodeBinaryExecutor {
368321 return ;
369322 }
370323
371- // Parse deployment ID from output
372- let deploymentId : string | undefined ;
373- const deploymentIdPattern = / D e p l o y m e n t I D : ( .+ ) / i;
374- const deploymentMatch = deploymentIdPattern . exec ( stdoutTrimmed ) ;
375- if ( deploymentMatch ) {
376- deploymentId = deploymentMatch [ 1 ] . trim ( ) ;
377- }
378-
379- // Parse endpoint URL from output
380- let endpointUrl : string | undefined ;
381- const endpointUrlPattern = / E n d p o i n t U R L : ( .+ ) / i;
382- const endpointMatch = endpointUrlPattern . exec ( stdoutTrimmed ) ;
383- if ( endpointMatch ) {
384- endpointUrl = endpointMatch [ 1 ] . trim ( ) ;
385- }
386-
387- // Parse deployment status from output
388- let status : string | undefined ;
389- const statusPattern = / S t a t u s : ( .+ ) / i;
390- const statusMatch = statusPattern . exec ( stdoutTrimmed ) ;
391- if ( statusMatch ) {
392- status = statusMatch [ 1 ] . trim ( ) ;
393- }
394-
395324 resolve ( {
396325 stdout : stdoutTrimmed ,
397326 stderr : stderrTrimmed ,
398- deploymentId,
399- endpointUrl,
400- status,
401327 } ) ;
402328 } ) ;
403329
@@ -446,27 +372,9 @@ export class DatacodeBinaryExecutor {
446372 timeout : 300_000 ,
447373 } ) ;
448374
449- // Parse status from output
450- let status : string | undefined ;
451- const statusPattern = / S t a t u s : ( .+ ) / i;
452- const statusMatch = statusPattern . exec ( stdout ) ;
453- if ( statusMatch ) {
454- status = statusMatch [ 1 ] . trim ( ) ;
455- }
456-
457- // Parse run output from output
458- let output : string | undefined ;
459- const outputPattern = / O u t p u t : ( .+ ) / i;
460- const outputMatch = outputPattern . exec ( stdout ) ;
461- if ( outputMatch ) {
462- output = outputMatch [ 1 ] . trim ( ) ;
463- }
464-
465375 return {
466376 stdout : stdout . trim ( ) ,
467377 stderr : stderr . trim ( ) ,
468- status,
469- output,
470378 } ;
471379 } catch ( error ) {
472380 const spawnError = error as SpawnError ;
0 commit comments