SpotiFlyer/console-app/src/main/java/common/Parameters.kt
2021-06-20 02:16:59 +05:30

30 lines
1005 B
Kotlin

package common
import utils.byOptionalProperty
import utils.byProperty
internal data class Parameters(
val githubToken: String,
val ownerName: String,
val repoName: String,
val branchName: String,
val filePath: String,
val imageDescription: String,
val commitMessage: String,
val tagName: String
) {
companion object {
fun initParameters() = Parameters(
githubToken = "GH_TOKEN".byProperty,
ownerName = "OWNER_NAME".byProperty,
repoName = "REPO_NAME".byProperty,
branchName = "BRANCH_NAME".byOptionalProperty ?: "main",
filePath = "FILE_PATH".byOptionalProperty ?: "README.md",
imageDescription = "IMAGE_DESCRIPTION".byOptionalProperty ?: "IMAGE",
commitMessage = "COMMIT_MESSAGE".byOptionalProperty ?: "HTML-TO-IMAGE Update",
tagName = "TAG_NAME".byOptionalProperty ?: "HTI"
// hctiKey = "HCTI_KEY".analytics_html_img.getByProperty
)
}
}