diff --git a/bin/unko.say b/bin/unko.say index 4e7f134..49dee64 100755 --- a/bin/unko.say +++ b/bin/unko.say @@ -9,13 +9,10 @@ readonly THIS_DIR LIB_DIR="${THIS_DIR}/../lib/super_unko" readonly LIB_DIR -case ${OSTYPE} in - darwin*) - COW_FILE="${LIB_DIR}/unko_mb.cow" - ;; - *) - COW_FILE="${LIB_DIR}/unko.cow" - ;; -esac +COW_FILE="${LIB_DIR}/unko_mb.cow" +if ! (cowsay -f "${COW_FILE}" 'うんこ' | grep -qe 'うんこ' && + cowsay -f "${COW_FILE}" 'もりもり' | grep -qe '💩'); then + COW_FILE="${LIB_DIR}/unko.cow" +fi cowsay -f "${COW_FILE}" "$@" diff --git a/bin/unko.think b/bin/unko.think index de6b08d..436fd58 100755 --- a/bin/unko.think +++ b/bin/unko.think @@ -9,13 +9,10 @@ readonly THIS_DIR LIB_DIR="${THIS_DIR}/../lib/super_unko" readonly LIB_DIR -case ${OSTYPE} in - darwin*) - COW_FILE="${LIB_DIR}/unko_mb.cow" - ;; - *) - COW_FILE="${LIB_DIR}/unko.cow" - ;; -esac +COW_FILE="${LIB_DIR}/unko_mb.cow" +if ! (cowsay -f "${COW_FILE}" 'うんこ' | grep -qe 'うんこ' && + cowsay -f "${COW_FILE}" 'もりもり' | grep -qe '💩'); then + COW_FILE="${LIB_DIR}/unko.cow" +fi cowthink -f "${COW_FILE}" "$@"