src/aws/install-aws-cli/src.main.kts [436:459]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fun Path.getOrTemp(): Path { if (Files.notExists(this)) { try { Files.createDirectories(this) } catch (e: IOException) { return fallbackWithWarning(this, e) } } if (Files.isDirectory(this)) { try { Files.createTempFile(this, "write-test-", ".tmp").let { testFile -> Files.deleteIfExists(testFile) } return this } catch (e: IOException) { return fallbackWithWarning(this, e) } } return fallbackWithWarning(this, IOException("Not a directory")) } fun fallbackWithWarning(path: Path, cause: Exception): Path { val tmpDir = System.getProperty("java.io.tmpdir") ?: throw IllegalStateException("No 'java.io.tmpdir' defined", cause) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/setup-bazelisk/src.main.kts [294:317]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fun Path.getOrTemp(): Path { if (Files.notExists(this)) { try { Files.createDirectories(this) } catch (e: IOException) { return fallbackWithWarning(this, e) } } if (Files.isDirectory(this)) { try { Files.createTempFile(this, "write-test-", ".tmp").let { testFile -> Files.deleteIfExists(testFile) } return this } catch (e: IOException) { return fallbackWithWarning(this, e) } } return fallbackWithWarning(this, IOException("Not a directory")) } fun fallbackWithWarning(path: Path, cause: Exception): Path { val tmpDir = System.getProperty("java.io.tmpdir") ?: throw IllegalStateException("No 'java.io.tmpdir' defined", cause) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -