■ ■ ■ ■ ■ ■
src/main/java/io/onedev/agent/ShellExecutorUtils.java
| skipped 326 lines |
327 | 327 | | } |
328 | 328 | | |
329 | 329 | | public static File resolveCachePath(File workspaceDir, String cachePath) { |
330 | | - | if (cachePath.startsWith(KubernetesHelper.HOME_PREFIX)) { |
331 | | - | File homeDir = new File(System.getProperty("user.home")); |
332 | | - | return new File(homeDir, cachePath.substring(KubernetesHelper.HOME_PREFIX.length())); |
333 | | - | } else { |
334 | | - | File cacheDir = new File(cachePath); |
335 | | - | if (cacheDir.isAbsolute()) |
336 | | - | throw new ExplicitException("Shell executor does not support absolute cache path: " + cachePath); |
337 | | - | else |
338 | | - | return new File(workspaceDir, cachePath); |
339 | | - | } |
| 330 | + | File cacheDir = new File(cachePath); |
| 331 | + | if (cacheDir.isAbsolute()) |
| 332 | + | throw new ExplicitException("Shell executor does not support absolute cache path: " + cachePath); |
| 333 | + | else |
| 334 | + | return new File(workspaceDir, cachePath); |
340 | 335 | | } |
341 | 336 | | |
342 | 337 | | public static void testCommands(Commandline git, List<String> commands, TaskLogger jobLogger) { |
| skipped 56 lines |