| 61 | #ifdef _WIN32 |
| 62 | |
| 63 | static inline bool |
| 64 | copyWrapper(const os::String & wrapperPath, |
| 65 | const char *programPath, |
| 66 | bool verbose) |
| 67 | { |
| 68 | os::String wrapperFilename(wrapperPath); |
| 69 | wrapperFilename.trimDirectory(); |
| 70 | |
| 71 | os::String tmpWrapper(programPath); |
| 72 | tmpWrapper.trimFilename(); |
| 73 | tmpWrapper.join(wrapperFilename); |
| 74 | |
| 75 | if (verbose) { |
| 76 | std::cerr << wrapperPath << " -> " << tmpWrapper << "\n"; |
| 77 | } |
| 78 | |
| 79 | if (tmpWrapper.exists()) { |
| 80 | std::cerr << "error: not overwriting " << tmpWrapper << "\n"; |
| 81 | return false; |
| 82 | } |
| 83 | |
| 84 | if (!os::copyFile(wrapperPath, tmpWrapper, false)) { |
| 85 | std::cerr << "error: failed to copy " << wrapperPath << " into " << tmpWrapper << "\n"; |
| 86 | return false; |
| 87 | } |
| 88 | |
| 89 | return true; |
| 90 | } |
| 91 | |
| 92 | #endif /* _WIN32 */ |
| 93 |
no test coverage detected