(String directory)
| 345 | } |
| 346 | |
| 347 | public static int sameUser(String directory) throws Exception { |
| 348 | Path path = Path.of(directory); |
| 349 | if (Files.exists(path)) { |
| 350 | String userForDir = userForDir(path); |
| 351 | if (!currentUser().equals(userForDir)) { |
| 352 | return exitOrException("Must run as user " + userForDir + ". We are " + currentUser()); |
| 353 | } |
| 354 | } else { |
| 355 | return exitOrException("Directory " + directory + " does not exist."); |
| 356 | } |
| 357 | return 0; |
| 358 | } |
| 359 | |
| 360 | public static int assertFileExists(String directory) throws Exception { |
| 361 | if (!Files.exists(Path.of(directory))) { |
no test coverage detected