(src, dest)
| 2114 | const RESERVED_WIN_NAMES = ['con', 'prn', 'aux', 'nul', 'com0', 'com1', 'com2', 'com3', 'com4', 'com5', 'com6', 'com7', 'com8', 'com9', 'lpt0', 'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5', 'lpt6', 'lpt7', 'lpt8', 'lpt9']; |
| 2115 | |
| 2116 | function copyDirContents(src, dest) { |
| 2117 | if (!fs.existsSync(src)) return; |
| 2118 | fs.mkdirSync(dest, { recursive: true }); |
| 2119 | const SKIP_DIRS = ['node_modules', '.git', '.next', 'cache']; |
| 2120 | const SKIP_EXT = ['.log', '.tmp', '.db', '.sqlite', '.cache', '.pack', '.idx']; |
| 2121 | |
| 2122 | for (const name of fs.readdirSync(src)) { |
| 2123 | if (RESERVED_WIN_NAMES.includes(name.toLowerCase())) { |
| 2124 | console.warn(`Skipping reserved Windows filename: ${name}`); |
| 2125 | continue; |
| 2126 | } |
| 2127 | |
| 2128 | const srcPath = path.join(src, name); |
| 2129 | const destPath = path.join(dest, name); |
| 2130 | const stat = fs.statSync(srcPath); |
| 2131 | |
| 2132 | if (stat.isDirectory()) { |
| 2133 | if (SKIP_DIRS.includes(name)) continue; |
| 2134 | copyDirContents(srcPath, destPath); |
| 2135 | } else { |
| 2136 | if (SKIP_EXT.some(ext => name.endsWith(ext))) continue; |
| 2137 | fs.copyFileSync(srcPath, destPath); |
| 2138 | } |
| 2139 | } |
| 2140 | } |
| 2141 | |
| 2142 | function execPromise(cmd, opts = {}) { |
| 2143 | return new Promise((resolve, reject) => { |
no outgoing calls
no test coverage detected