You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2021/04/07 02:45:02 UTC
[groovy] 01/04: Create codenarc.sh
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit ba743872b334bdd22264c07d43b4b19fa88eb435
Author: Stephen Magill <st...@gmail.com>
AuthorDate: Fri Feb 19 16:25:26 2021 -0500
Create codenarc.sh
---
.muse/codenarc.sh | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/.muse/codenarc.sh b/.muse/codenarc.sh
new file mode 100644
index 0000000..ab3bc85
--- /dev/null
+++ b/.muse/codenarc.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+commit=$2
+cmd=$3
+
+function version() {
+ echo 1
+}
+
+function applicable() {
+ echo "true"
+}
+
+function gettool() {
+ pushd /tmp >/dev/null
+ curl -s -o CodeNarc-2.0.0.tgz -LO https://github.com/smagill/codenarc-muse/blob/main/CodeNarc-2.0.0.tgz?raw=true
+ tar xzf CodeNarc-2.0.0.tgz
+ popd >/dev/null
+}
+
+function emit_results() {
+ echo "$1"
+}
+
+function run() {
+ gettool
+ raw_results=$(/tmp/codenarc ./)
+ emit_results "$raw_results"
+}
+
+if [[ "$cmd" = "run" ]] ; then
+ run
+fi
+if [[ "$cmd" = "applicable" ]] ; then
+ applicable
+fi
+if [[ "$cmd" = "version" ]] ; then
+ version
+fi