File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ async function runStdioDiscovery(modulePath: string): Promise<DiscoveryResult> {
210
210
211
211
proc . on ( "close" , ( ) => {
212
212
clearTimeout ( timeoutId ) ;
213
- const manifestMatch = stderr . match ( / _ _ F I R E B A S E _ F U N C T I O N S _ M A N I F E S T _ _ : ( [ \s \S ] + ) / ) ;
213
+ const manifestMatch = stderr . match ( / < F I R E B A S E _ F U N C T I O N S _ M A N I F E S T > \n ( [ \s \S ] + ? ) \n < \/ F I R E B A S E _ F U N C T I O N S _ M A N I F E S T > / ) ;
214
214
if ( manifestMatch ) {
215
215
const base64 = manifestMatch [ 1 ] ;
216
216
const manifestJson = Buffer . from ( base64 , "base64" ) . toString ( "utf8" ) ;
@@ -219,7 +219,7 @@ async function runStdioDiscovery(modulePath: string): Promise<DiscoveryResult> {
219
219
return ;
220
220
}
221
221
222
- const errorMatch = stderr . match ( / _ _ F I R E B A S E _ F U N C T I O N S _ M A N I F E S T _ E R R O R _ _ : ( [ \s \S ] + ) / ) ;
222
+ const errorMatch = stderr . match ( / < F I R E B A S E _ F U N C T I O N S _ M A N I F E S T _ E R R O R > \n ( [ \s \S ] + ? ) \n < \/ F I R E B A S E _ F U N C T I O N S _ M A N I F E S T _ E R R O R > / ) ;
223
223
if ( errorMatch ) {
224
224
resolve ( { success : false , error : errorMatch [ 1 ] } ) ;
225
225
return ;
Original file line number Diff line number Diff line change @@ -49,21 +49,23 @@ if (args.length > 1) {
49
49
functionsDir = args [ 0 ] ;
50
50
}
51
51
52
- const MANIFEST_PREFIX = "__FIREBASE_FUNCTIONS_MANIFEST__:" ;
53
- const MANIFEST_ERROR_PREFIX = "__FIREBASE_FUNCTIONS_MANIFEST_ERROR__:" ;
52
+ const MANIFEST_START_TAG = "<FIREBASE_FUNCTIONS_MANIFEST>" ;
53
+ const MANIFEST_END_TAG = "</FIREBASE_FUNCTIONS_MANIFEST>" ;
54
+ const MANIFEST_ERROR_START_TAG = "<FIREBASE_FUNCTIONS_MANIFEST_ERROR>" ;
55
+ const MANIFEST_ERROR_END_TAG = "</FIREBASE_FUNCTIONS_MANIFEST_ERROR>" ;
54
56
55
57
async function runStdioDiscovery ( ) {
56
58
try {
57
59
const stack = await loadStack ( functionsDir ) ;
58
60
const wireFormat = stackToWire ( stack ) ;
59
61
const manifestJson = JSON . stringify ( wireFormat ) ;
60
62
const base64 = Buffer . from ( manifestJson ) . toString ( "base64" ) ;
61
- process . stderr . write ( `${ MANIFEST_PREFIX } ${ base64 } \n` ) ;
63
+ process . stderr . write ( `${ MANIFEST_START_TAG } \n ${ base64 } \n ${ MANIFEST_END_TAG } \n` ) ;
62
64
process . exitCode = 0 ;
63
65
} catch ( e ) {
64
66
console . error ( "Failed to generate manifest from function source:" , e ) ;
65
67
const message = e instanceof Error ? e . message : String ( e ) ;
66
- process . stderr . write ( `${ MANIFEST_ERROR_PREFIX } ${ message } \n` ) ;
68
+ process . stderr . write ( `${ MANIFEST_ERROR_START_TAG } \n ${ message } \n ${ MANIFEST_ERROR_END_TAG } \n` ) ;
67
69
process . exitCode = 1 ;
68
70
}
69
71
}
You can’t perform that action at this time.
0 commit comments