(from: string, to: string, flags = 0)
| 1677 | // the link itself, and it's an error if the link doesn't point to a file). |
| 1678 | const wrappedCopyFile = wrapDestructiveFsFunc("copyFile", fs.copyFileSync, [0, 1]); |
| 1679 | export function copyFile(from: string, to: string, flags = 0) { |
| 1680 | mkdir_p(pathDirname(pathResolve(to)), 0o755); |
| 1681 | wrappedCopyFile(from, to, flags); |
| 1682 | const stat = statOrNull(from); |
| 1683 | if (stat && stat.isFile()) { |
| 1684 | // Create the file as readable and writable by everyone, and executable by |
| 1685 | // everyone if the original file is executably by owner. (This mode will be |
| 1686 | // modified by umask.) We don't copy the mode *directly* because this function |
| 1687 | // is used by 'meteor create' which is copying from the read-only tools tree |
| 1688 | // into a writable app. |
| 1689 | chmod(to, (stat.mode & 0o100) ? 0o777 : 0o666); |
| 1690 | } |
| 1691 | } |
| 1692 | |
| 1693 | const wrappedRename = wrapDestructiveFsFunc("rename", fs.renameSync, [0, 1]); |
| 1694 | export const rename = isWindowsLikeFilesystem() ? function (from: string, to: string) { |
no test coverage detected
searching dependent graphs…