(path = '')
| 43 | } |
| 44 | |
| 45 | function getModeFromPath(path = '') { |
| 46 | const matchExts = (...exts) => exts.find((ext) => path.endsWith(ext)); |
| 47 | |
| 48 | if (matchExts('.append')) { |
| 49 | return 'append'; |
| 50 | } |
| 51 | if (matchExts('.append.template', '.template.append')) { |
| 52 | return 'appendTemplate'; |
| 53 | } |
| 54 | if (matchExts('.template')) { |
| 55 | return 'copyTemplate'; |
| 56 | } |
| 57 | return 'copy'; |
| 58 | } |
| 59 | |
| 60 | const copyLoader = ({ root, templateDir, verbose }) => ({ path }) => { |
| 61 | copyFile(`${templateDir}/${path}`, `${root}/${path}`, verbose); |
no test coverage detected