Merge pull request #16 from opencultureconsulting:felixlohmeier/shellcheck-directives-15

shellcheck directives
This commit is contained in:
Felix Lohmeier 2022-04-04 22:40:21 +02:00 committed by GitHub
commit 16b62a143e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 8 deletions

View File

@ -1,2 +1,2 @@
#!/usr/bin/env bash
# shellcheck shell=bash
get_id

View File

@ -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

View File

@ -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 $*"
}

View File

@ -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

View File

@ -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

View File

@ -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