(from, to)
| 8 | const targz = require('targz'); |
| 9 | |
| 10 | function asyncCopyTo(from, to) { |
| 11 | return asyncMkDirP(path.dirname(to)).then( |
| 12 | () => |
| 13 | new Promise((resolve, reject) => { |
| 14 | ncp(from, to, error => { |
| 15 | if (error) { |
| 16 | // Wrap to have a useful stack trace. |
| 17 | reject(new Error(error)); |
| 18 | } else { |
| 19 | // Wait for copied files to exist; ncp() sometimes completes prematurely. |
| 20 | // For more detail, see github.com/facebook/react/issues/22323 |
| 21 | // Also github.com/AvianFlu/ncp/issues/127 |
| 22 | setTimeout(resolve, 10); |
| 23 | } |
| 24 | }); |
| 25 | }) |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | function asyncExecuteCommand(command) { |
| 30 | return new Promise((resolve, reject) => |
no test coverage detected