Created
November 27, 2017 21:54
-
-
Save r3b311i0n/73ad2ad494094463c8303188db5f4ce7 to your computer and use it in GitHub Desktop.
Script for extracting gresource archives.
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
# The GResource file name | |
GR_FILE="gtk.gresource" | |
# The base folder of the extracted resources | |
GR_BASEDIR="/org/gnome/" | |
## Check for required utilities... | |
for REQUIRED_PROG in gresource | |
do | |
which ${REQUIRED_PROG} &>/dev/null | |
if [ $? -ne 0 ]; then | |
echo "Unable to find required program '${REQUIRED_PROG}' in PATH." | |
exit 1 | |
fi | |
done | |
for RSRC in $(gresource list $GR_FILE) | |
do | |
RSRC_FILE=$(echo "${RSRC#$GR_BASEDIR}") | |
mkdir -p $(dirname "./$RSRC_FILE") ||: | |
gresource extract "$GR_FILE" "$RSRC" > "./$RSRC_FILE" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment