Skip to content

Commit

Permalink
ob_gen: --png allows to optionally bake a PNG badge instead of SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
hoijui committed Dec 6, 2023
1 parent 94b6649 commit 32e96e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ob_gen
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
SCRIPT_NAME="$(basename "$SCRIPT_PATH")"
OUT_DIR_DEFAULT="build"
REQUIRED_TOOLS=("jq" "bc" "sed" "awk" "repvar" "obadgen" "openssl")
IMGS_VECTOR_LOCAL_BASE="$SCRIPT_DIR/resources/media/img"
IMGS_BINARY_LOCAL_BASE="$SCRIPT_DIR/resources/assets/media/img"

# parameters
# repo="$(pwd)"
out_dir="$OUT_DIR_DEFAULT"
force=false
example=false
IMG_EXT="svg"
IMGS_LOCAL_BASE="$IMGS_VECTOR_LOCAL_BASE"

function print_help() {

Expand All @@ -45,6 +49,8 @@ function print_help() {
echo -e " Where to find the locally stored osh-tool JSON report"
echo -e " --example"
echo -e " Use example data from an osh-tool of the OHLOOM project"
echo -e " --png"
echo -e " Use PNG instead of the default SVG for the bage format"
echo -e " -f, --force"
echo -e " Forces overwriting the signign certificate/key, if it already exists"
echo -e " -h, --help"
Expand Down Expand Up @@ -86,6 +92,10 @@ do
--example)
example=true
;;
--png)
IMG_EXT="png"
IMGS_LOCAL_BASE="$IMGS_BINARY_LOCAL_BASE"
;;
-f|--force)
force=true
;;
Expand Down Expand Up @@ -161,7 +171,6 @@ fi
VARIABLES_FILE="$out_dir/assertion-gen.vars.txt"
OB_HOSTING_BASE="https://raw.githubusercontent.com/hoijui/osh-tool/master/resources/open-badge-examples/compliance-signed"
OB_LOCAL_BASE="$SCRIPT_DIR/resources/open-badge-examples/compliance-signed"
IMGS_LOCAL_BASE="$SCRIPT_DIR/resources/media/img"
KEY_FILE_BASE="$OB_LOCAL_BASE/issuer-key"
PRIV_KEY_PEM="$KEY_FILE_BASE.x509.priv.pem"
PRIV_KEY_DER="$KEY_FILE_BASE.x509.priv.der"
Expand All @@ -174,7 +183,6 @@ KEY_ID="$OB_HOSTING_BASE/$(basename "$KEY_JSON")"
# ALG="es256"
ALG="rs256"
KEY_VALIDITY_DAYS="730"
IMG_EXT="svg"
RECIPIENT_SALT="dfvnk097t6iubasr$RANDOM"
OSH_TOOL_REPORT_JSON_URL="$PROJECT_HOSTING_BASE_URL/osh-report.json"
OSH_TOOL_REPORT_HTML_URL="$PROJECT_HOSTING_BASE_URL/osh-report.html"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 32e96e1

Please sign in to comment.