| 228 | } |
| 229 | |
| 230 | function clonePath(source, destination) { |
| 231 | const stats = statSync(source); |
| 232 | if (stats.isFile()) { |
| 233 | try { |
| 234 | copyFileSync(source, destination, constants.COPYFILE_FICLONE); |
| 235 | } catch { |
| 236 | copyFileSync(source, destination); |
| 237 | } |
| 238 | return; |
| 239 | } |
| 240 | |
| 241 | try { |
| 242 | cpSync(source, destination, { |
| 243 | recursive: true, |
| 244 | verbatimSymlinks: true, |
| 245 | preserveTimestamps: true, |
| 246 | mode: constants.COPYFILE_FICLONE, |
| 247 | }); |
| 248 | } catch { |
| 249 | cpSync(source, destination, { |
| 250 | recursive: true, |
| 251 | verbatimSymlinks: true, |
| 252 | preserveTimestamps: true, |
| 253 | }); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | function existsAndHasContent(path) { |
| 258 | try { |