Skip to content

Commit

Permalink
workie ???
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxikle committed Jun 13, 2024
1 parent 65bc368 commit ce8f04a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,18 @@ publishing {
authentication {
create<BasicAuthentication>("basic") {
// Use providers to get the properties or fallback to environment variables
val user =
providers.gradleProperty("username").orElse(System.getenv("REPO_USERNAME")).orElse("null")
val pass =
providers.gradleProperty("password").orElse(System.getenv("REPO_PASSWORD")).orElse("null")
println("pass: " + pass.isPresent + " | user: " + user.isPresent)


var u = System.getenv("REPO_USERNAME")
var p = System.getenv("REPO_PASSWORD")

if (user.get().isEmpty() || !user.isPresent) {
user.orElse("no-value-provided")
if (u.isEmpty()) {
u = "no-value-provided"
}
if (p.isEmpty()) {
p = "no-value-provided"
}

val user = providers.gradleProperty("username").orElse(u)
val pass = providers.gradleProperty("password").orElse(p)

println("pass: " + pass.isPresent + " | user: " + user.isPresent)
credentials {
Expand Down

0 comments on commit ce8f04a

Please sign in to comment.