diff --git a/apps/cli/src/commands/publish.ts b/apps/cli/src/commands/publish.ts index ecf2c6e7e..f0c8a9075 100644 --- a/apps/cli/src/commands/publish.ts +++ b/apps/cli/src/commands/publish.ts @@ -285,14 +285,18 @@ export const handlePublishCliCommand = async (options: { codemodFilePaths.map(async (path) => { const searchTerm = `${source}${sep}`; - return { - name: path - .slice(path.indexOf(searchTerm) + searchTerm.length) - .replace(/\\/g, "/"), - data: await fs.promises.readFile(path), - }; + try { + return { + name: path + .slice(path.indexOf(searchTerm) + searchTerm.length) + .replace(/\\/g, "/"), + data: await fs.promises.readFile(path), + }; + } catch { + return undefined; + } }), - ); + ).then((buffers) => buffers.filter((buffer) => !!buffer)); if (codemodRc.engine !== "recipe") { const builtExecutable = await getCodemodExecutable(