(fileUpdates: FsUpdates, srcPath: string, destPath: string)
| 179 | } |
| 180 | |
| 181 | async function mergeIgnoresFile(fileUpdates: FsUpdates, srcPath: string, destPath: string) { |
| 182 | const srcContent = await fs.promises.readFile(srcPath, 'utf-8'); |
| 183 | |
| 184 | try { |
| 185 | const destContent = await fs.promises.readFile(destPath, 'utf-8'); |
| 186 | const srcLines = srcContent.trim().split(/\r?\n/); |
| 187 | const destLines = destContent.trim().split(/\r?\n/); |
| 188 | for (const srcLine of srcLines) { |
| 189 | if (!destLines.includes(srcLine)) { |
| 190 | if (srcLine.startsWith('#')) { |
| 191 | destLines.push(''); |
| 192 | } |
| 193 | destLines.push(srcLine); |
| 194 | } |
| 195 | } |
| 196 | fileUpdates.files.push({ |
| 197 | path: destPath, |
| 198 | content: destLines.join('\n').trim() + '\n', |
| 199 | type: 'modify', |
| 200 | }); |
| 201 | } catch (e) { |
| 202 | fileUpdates.files.push({ |
| 203 | path: destPath, |
| 204 | content: srcContent, |
| 205 | type: 'create', |
| 206 | }); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | async function mergeCss( |
| 211 | fileUpdates: FsUpdates, |
no test coverage detected
searching dependent graphs…