From 5c7efcd10ed7ce07b5eb9e14435b54c151595aa0 Mon Sep 17 00:00:00 2001 From: kageru Date: Thu, 14 Nov 2019 14:58:01 +0100 Subject: [PATCH] Add ktlint to deployment process --- check.sh | 2 ++ deploy.sh | 2 +- src/main/kotlin/moe/kageru/kagebot/command/Permissions.kt | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100755 check.sh diff --git a/check.sh b/check.sh new file mode 100755 index 0000000..38b755e --- /dev/null +++ b/check.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ktlint --disabled_rules import-ordering,no-wildcard-imports diff --git a/deploy.sh b/deploy.sh index 9d7cdbf..9110500 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,5 @@ #!/bin/sh -if gradle test; then +if ./check.sh && gradle test; then gradle shadowjar scp build/libs/moe.kageru.kagebot-0.1-all.jar lain:/home/selphybot/bot.jar ssh lain sudo systemctl restart selphybot.service diff --git a/src/main/kotlin/moe/kageru/kagebot/command/Permissions.kt b/src/main/kotlin/moe/kageru/kagebot/command/Permissions.kt index f2212a5..2f2517b 100644 --- a/src/main/kotlin/moe/kageru/kagebot/command/Permissions.kt +++ b/src/main/kotlin/moe/kageru/kagebot/command/Permissions.kt @@ -22,7 +22,7 @@ class Permissions( message.messageAuthor.isBotOwner -> true onlyDM && !message.isPrivateMessage -> false // returns true if the Option is empty (case for no restrictions) - else -> hasOneOf.forall { Util.hasOneOf(message.messageAuthor, it) } - && hasNoneOf.forall { !Util.hasOneOf(message.messageAuthor, it) } + else -> hasOneOf.forall { Util.hasOneOf(message.messageAuthor, it) } && + hasNoneOf.forall { !Util.hasOneOf(message.messageAuthor, it) } } }