forked from binwiederhier/ntfy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Philipp Heckel
committed
Nov 29, 2021
1 parent
8616be1
commit 28f4e1e
Showing
4 changed files
with
22,773 additions
and
22,749 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# This script reduces the size and converts the emoji.json file from https://github.com/github/gemoji/blob/master/db/emoji.json | ||
# to be used in the Android app (app/src/main/resources/emoji.json) and the Web UI (server/static/js/emoji.js). | ||
|
||
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)" | ||
ROOTDIR="$(cd "$(dirname "$0")/.." && pwd)" | ||
|
||
if [ -z "$1" ]; then | ||
echo "Syntax: $0 FILE.(js|json)" | ||
echo "Example:" | ||
echo " $0 emoji-converted.json" | ||
echo " $0 $ROOTDIR/server/static/js/emoji.js" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$1" == *.js ]]; then | ||
echo -n "// This file is generated by scripts/emoji-convert.sh to reduce the size | ||
// Original data source: https://github.com/github/gemoji/blob/master/db/emoji.json | ||
const rawEmojis = " > "$1" | ||
cat "$SCRIPTDIR/emoji.json" | jq -rc 'map({emoji: .emoji,aliases: .aliases})' >> "$1" | ||
else | ||
cat "$SCRIPTDIR/emoji.json" | jq -rc 'map({emoji: .emoji,aliases: .aliases})' > "$1" | ||
fi |
Oops, something went wrong.