daml/dev-env/bin/data-uri
Digital Asset GmbH 05e691f558 open-sourcing daml
2019-04-04 09:33:38 +01:00

6 lines
170 B
Bash
Executable File

#!/usr/bin/env bash
CONTENT=$(cat $*)
MIMETYPE=$(echo "$CONTENT" | file -bN --mime-type -)
CONTENT=$(echo "$CONTENT" | base64 -w 0)
echo "data:$MIMETYPE;base64,$CONTENT"