Skip to content

Commit

Permalink
Revert "refactor: sh interpreter"
Browse files Browse the repository at this point in the history
This reverts commit bb9988c.
  • Loading branch information
tpluscode committed Nov 28, 2023
1 parent bb9988c commit d4c3c61
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/profiles.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
FAILED=0

SHACL_PLAYGROUND_URL="https://shacl-playground.zazuko.com/"
SHORTENER="https://s.zazuko.com/api/v1/shorten/"

urlencode() {
function urlencode() {
set +x

string="$1"
strlen=${#string}
encoded=""
pos c o
local string="$1"
local strlen=${#string}
local encoded=""
local pos c o

for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded="${encoded}${o}"
encoded+="${o}"
done
echo "${encoded}"
}

getPlaygroundUrl() {
playgroundUrl="$SHACL_PLAYGROUND_URL#page=2&shapesGraph=$(urlencode "$1")&dataGraph=$(urlencode "$2")&dataGraphFormat=text%2Fturtle"
function getPlaygroundUrl() {
local playgroundUrl="$SHACL_PLAYGROUND_URL#page=2&shapesGraph=$(urlencode "$1")&dataGraph=$(urlencode "$2")&dataGraphFormat=text%2Fturtle"
curl -s $SHORTENER --data-raw "url=$playgroundUrl"
}

reportFailure() {
function reportFailure() {
playground=$(getPlaygroundUrl "$1" "$2")
echo "❌ FAIL - check report on $playground"
}
Expand Down

0 comments on commit d4c3c61

Please sign in to comment.