def patch()

in ideaSupport/src/main/scala/org/jetbrains/sbtidea/xml/PluginXmlPatcher.scala [10:26]


  def patch(options: pluginXmlOptions): Path = try {
    val content = new String(Files.readAllBytes(input))
    if (content.isEmpty) {
      log.error(s"Patching failed: $input exists but is empty")
      input
    } else {
      val result = transform(content, options)
      if (!createCopy)
        Files.write(input, result.getBytes)
      else
        Files.write(Files.createTempFile("", "plugin.xml"), result.getBytes)
    }
  } catch {
    case e: Exception =>
      log.error(s"Patching failed: $e")
      input
  }