(
from: { version: string; files: string[] },
to: { version: string; files: string[] }
)
| 97 | }; |
| 98 | |
| 99 | const getDiff = ( |
| 100 | from: { version: string; files: string[] }, |
| 101 | to: { version: string; files: string[] } |
| 102 | ) => { |
| 103 | const filesToUpdate: string[] = []; |
| 104 | |
| 105 | for (const file of to.files) { |
| 106 | if (allInternalContent.some((ic) => file.startsWith(ic))) { |
| 107 | continue; |
| 108 | } |
| 109 | |
| 110 | if (!from.files.includes(file)) { |
| 111 | filesToUpdate.push(file); |
| 112 | continue; |
| 113 | } |
| 114 | |
| 115 | const result = run( |
| 116 | "git", |
| 117 | ["diff", from.version, to.version, "--", cleanFileName(file)], |
| 118 | { stdio: "pipe", maxBuffer: 1024 * 1024 * 1024 } |
| 119 | ); |
| 120 | |
| 121 | const hasChanged = result.stdout.toString().trim() !== ""; |
| 122 | |
| 123 | if (hasChanged) { |
| 124 | filesToUpdate.push(file); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | return filesToUpdate; |
| 129 | }; |
| 130 | |
| 131 | export const update = async (options: { from?: string; to?: string }) => { |
| 132 | try { |
no test coverage detected