(srcPath, dstPath string, mode os.FileMode)
| 1152 | } |
| 1153 | dstPath := filepath.Join(dstRoot, rel) |
| 1154 | |
| 1155 | info, err := os.Lstat(path) |
| 1156 | if err != nil { |
| 1157 | return err |
| 1158 | } |
| 1159 | if walkInfo != nil { |
| 1160 | info = walkInfo |
| 1161 | } |
| 1162 | if info.IsDir() { |
| 1163 | return os.MkdirAll(dstPath, 0o750) |
| 1164 | } |
| 1165 | if info.Mode()&os.ModeSymlink != 0 { |
| 1166 | return nil |
| 1167 | } |
| 1168 | if err := os.MkdirAll(filepath.Dir(dstPath), 0o750); err != nil { |
| 1169 | return err |
| 1170 | } |
| 1171 | if _, err := os.Stat(dstPath); err == nil { |
| 1172 | if !shouldRefreshBundledExtension(path) { |
| 1173 | return nil |
| 1174 | } |
| 1175 | } else if !errors.Is(err, os.ErrNotExist) { |
| 1176 | return err |
| 1177 | } |
| 1178 | |
| 1179 | return copyFile(path, dstPath, info.Mode().Perm()) |
| 1180 | }) |
| 1181 | } |
| 1182 | |
| 1183 | // shouldRefreshBundledExtension returns true for bundled extensions whose |
| 1184 | // on-disk copy in DataDir/extensions/v<ver>/<platform>/ must be overwritten |
no test coverage detected