diff --git a/scripts/patch-usesend.mjs b/scripts/patch-usesend.mjs index 0d32c59..c3fa1c6 100644 --- a/scripts/patch-usesend.mjs +++ b/scripts/patch-usesend.mjs @@ -7,11 +7,14 @@ const __dirname = path.dirname(__filename); const usesendDir = path.join(__dirname, '..', 'node_modules', 'usesend-js'); const ensureReplacement = (content, searchValue, replaceValue, filePath) => { - if (content.includes(replaceValue)) { + if (replaceValue !== '' && content.includes(replaceValue)) { return content; } if (!content.includes(searchValue)) { + if (replaceValue === '') { + return content; + } throw new Error(`Expected snippet not found in ${filePath}`); }