Skip to content
Snippets Groups Projects
Select Git revision
  • 989c407b0f9e7f485510eaa7d32170b24f5aa23a
  • main default protected
  • ui-rewrite
3 results

page_upload.go

Blame
  • ProjectHelper.kt 545 B
    import org.gradle.api.Project
    import java.io.ByteArrayOutputStream
    import java.util.*
    
    fun Project.cmd(vararg command: String) = try {
      val stdOut = ByteArrayOutputStream()
      exec {
        commandLine(*command)
        standardOutput = stdOut
      }
      stdOut.toString(Charsets.UTF_8.name()).trim()
    } catch (e: Throwable) {
      e.printStackTrace()
      null
    }
    
    fun Project.properties(fileName: String): Properties? {
      val file = file(fileName)
      if (!file.exists())
        return null
      val props = Properties()
      props.load(file.inputStream())
      return props
    }