process fails when one of the calls contains undefined for the data option #2

Open
opened 2022-01-01 19:20:29 +00:00 by Ghost · 0 comments

Seems to be called successfully many times but once it is given undefined for the data option in stageAsync which causes a rejection and failure.

Adding the following block to writeFileAsync allows the process to finish.

       if( !data ) {
         console.trace({
           filename,
           data,
           options,
         });
         data = `contents of '${ filename }' were not provided to safe-replace.\r\noption: '${ JSON.stringify( options ) }'`
        }

Seems to be called successfully many times but once it is given undefined for the data option in stageAsync which causes a rejection and failure. Adding the following block to `writeFileAsync` allows the process to finish. ```js if( !data ) { console.trace({ filename, data, options, }); data = `contents of '${ filename }' were not provided to safe-replace.\r\noption: '${ JSON.stringify( options ) }'` } ```
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coolaj86/fs-safe-replace.js#2
No description provided.