diff --git a/src/info_command.sh b/src/info_command.sh index 68bb0f6..2421a34 100644 --- a/src/info_command.sh +++ b/src/info_command.sh @@ -1,2 +1,2 @@ -#!/usr/bin/env bash +# shellcheck shell=bash get_id diff --git a/src/initialize.sh b/src/initialize.sh index a3b9c35..88ea9c1 100644 --- a/src/initialize.sh +++ b/src/initialize.sh @@ -1,3 +1 @@ -#!/usr/bin/env bash -## Code here runs inside the initialize() function -## Use it for anything that you need to run before any other function +# shellcheck shell=bash \ No newline at end of file diff --git a/src/lib/error.sh b/src/lib/error.sh index a6f0bd4..32780ab 100644 --- a/src/lib/error.sh +++ b/src/lib/error.sh @@ -1,5 +1,5 @@ -#!/usr/bin/env bash # log error message to STDERR +# shellcheck shell=bash function error() { echo >&2 "[$(date +'%Y-%m-%dT%H:%M:%S')]: ERROR $*" } diff --git a/src/lib/get_csrf.sh b/src/lib/get_csrf.sh index 62ba32a..c795a66 100644 --- a/src/lib/get_csrf.sh +++ b/src/lib/get_csrf.sh @@ -1,5 +1,5 @@ -#!/usr/bin/env bash # get CSRF token (introduced in OpenRefine 3.3) +# shellcheck shell=bash function get_csrf() { if [[ "${OPENREFINE_CSRF}" == true ]]; then local response diff --git a/src/lib/get_id.sh b/src/lib/get_id.sh index edbc930..c61b8ec 100644 --- a/src/lib/get_id.sh +++ b/src/lib/get_id.sh @@ -1,5 +1,5 @@ -#!/usr/bin/env bash # get project id (derived from project name if needed) +# shellcheck shell=bash disable=SC2154 function get_id() { local response local projects diff --git a/src/list_command.sh b/src/list_command.sh index 39d4c58..3e31ad0 100644 --- a/src/list_command.sh +++ b/src/list_command.sh @@ -1,5 +1,5 @@ -#!/usr/bin/env bash # get all project metadata and reshape json to print a list +# shellcheck shell=bash if ! response="$(curl -fs --get "${OPENREFINE_URL}/command/core/get-all-project-metadata")"; then error "no OpenRefine reachable/running at ${OPENREFINE_URL}" else