| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | const path = require('path'); |
||
| 14 | function copyFile(file, filePath) { |
||
| 15 | return new Promise(function (resolve) { |
||
| 16 | console.log(`copying ${file} to ${path.resolve(__dirname, '../lib', filePath)}`) |
||
|
|
|||
| 17 | return fs.copy( |
||
| 18 | file, |
||
| 19 | path.resolve( |
||
| 20 | __dirname, |
||
| 21 | '../lib', |
||
| 22 | filePath, |
||
| 23 | path.basename(file) |
||
| 24 | ), |
||
| 25 | function(error, data) { |
||
| 26 | if (error) { |
||
| 27 | throw new Error (`error copying file ${file}`, error); |
||
| 28 | } |
||
| 29 | return resolve(data); |
||
| 30 | } |
||
| 31 | ); |
||
| 32 | }); |
||
| 33 | } |
||
| 34 | |||
| 83 |